Changeset 7507


Ignore:
Timestamp:
Dec 26, 2008, 1:36:32 AM (12 years ago)
Author:
charles
Message:

(trunk daemon) #1619: tm-daemon: daemon mode fails on mipsel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/daemon.c

    r7503 r7507  
    8282}
    8383
     84#if defined(WIN32)
     85 #define USE_NO_DAEMON
     86#elif !defined(HAVE_DAEMON) || defined(__MIPSEL__)
     87 #define USE_TR_DAEMON
     88#else
     89 #define USE_OS_DAEMON
     90#endif
     91
    8492static int
    8593tr_daemon( int nochdir, int noclose )
    8694{
    87 #if defined(HAVE_DAEMON) && !defined(WIN32)
     95#if defined(USE_OS_DAEMON)
    8896    return daemon( nochdir, noclose );
    89 #else
     97#elif defined(USE_TR_DAEMON)
    9098    pid_t pid = fork( );
    9199    if( pid < 0 )
     
    126134        }
    127135    }
     136#else /* USE_NO_DAEMON */
     137    return 0;
    128138#endif
    129139}
     
    218228    }
    219229
    220 #ifndef WIN32
    221     if( !foreground )
     230    if( !foreground && tr_daemon( TRUE, FALSE ) < 0 )
    222231    {
    223         if( 0 > tr_daemon( TRUE, FALSE ) )
    224         {
    225             fprintf( stderr, "failed to daemonize: %s\n", strerror( errno ) );
    226             exit( 1 );
    227         }
    228     }
    229 #endif
     232        fprintf( stderr, "failed to daemonize: %s\n", strerror( errno ) );
     233        exit( 1 );
     234    }
    230235
    231236    /* start the session */
Note: See TracChangeset for help on using the changeset viewer.