Ignore:
Timestamp:
Jun 4, 2010, 3:11:43 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: merged changes from 3.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/web/startstop.c

    r414 r454  
    1919
    2020#include "includes.h"
     21
     22#ifdef __OS2__
     23        /* fork() in klibc on OS/2 ends all children when parent
     24           is closed, therefore we use spawn() */
     25#include "process.h"
     26#define SWAT_HELPER(WHAT, WHO) \
     27        asprintf(&binfile, "%s/swathelp.cmd", getcwd(NULL, _MAX_PATH)); \
     28        int rc; \
     29        rc=spawnl(P_NOWAIT, binfile, binfile, #WHAT, #WHO, NULL);
     30#endif
     31
    2132#include "web/swat_proto.h"
    2233#include "dynconfig.h"
     
    3243        }
    3344
     45#ifdef __OS2__
     46        /* fork() in klibc on OS/2 ends all children when parent
     47           is closed, therefore we use spawn() */
     48        SWAT_HELPER(start, smbd)       
     49#else   
    3450        if (fork()) {
    3551                return;
     
    4157        }
    4258        exit(0);
     59#endif
    4360}
    4461
     
    5269        }
    5370
     71#ifdef __OS2__
     72        /* fork() in klibc on OS/2 ends all children when parent
     73           is closed, therefore we use spawn() */
     74        SWAT_HELPER(start, nmbd)
     75#else   
    5476        if (fork()) {
    5577                return;
     
    6183        }
    6284        exit(0);
     85#endif
    6386}
    6487
     
    7295        }
    7396
     97#ifdef __OS2__
     98        /* fork() in klibc on OS/2 ends all children when parent
     99           is closed, therefore we use spawn() */
     100        SWAT_HELPER(start, winbindd)
     101#else   
    74102        if (fork()) {
    75103                return;
     
    81109        }
    82110        exit(0);
     111#endif
    83112}
    84113
     
    91120        if (geteuid() != 0) return;
    92121
     122#ifdef __OS2__  /* we do it a bit nicer */
     123        if (smbd_running()) {
     124                char *binfile = NULL;
     125                SWAT_HELPER(stop, smbd)
     126        }
     127#else
    93128        if (pid <= 0) return;
    94129
    95130        kill(pid, SIGTERM);
     131#endif
    96132}
    97133
     
    103139        if (geteuid() != 0) return;
    104140
     141#ifdef __OS2__  /* we do it a bit nicer */
     142        if (nmbd_running()) {
     143                char *binfile = NULL;
     144                SWAT_HELPER(stop, nmbd)
     145        }
     146#else
    105147        if (pid <= 0) return;
    106148
    107149        kill(pid, SIGTERM);
     150#endif
    108151}
    109152#ifdef WITH_WINBIND
     
    115158        if (geteuid() != 0) return;
    116159
     160#ifdef __OS2__  /* we do it a bit nicer */
     161        if (winbindd_running()) {
     162                char *binfile = NULL;
     163                SWAT_HELPER(stop, winbindd)
     164        }
     165#else
    117166        if (pid <= 0) return;
    118167
    119168        kill(pid, SIGTERM);
     169#endif
    120170}
    121171#endif
Note: See TracChangeset for help on using the changeset viewer.