Ignore:
Timestamp:
Nov 4, 2007, 3:16:40 AM (16 years ago)
Author:
Bruno Cornec
Message:

Update to busybox 1.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi-busybox/miscutils/setsid.c

    r821 r1765  
    1515 */
    1616
    17 #include "busybox.h"
    18 #include <stdio.h>
    19 #include <unistd.h>
    20 #include <stdlib.h>
     17#include "libbb.h"
    2118
    22 int setsid_main(int argc, char *argv[])
     19int setsid_main(int argc, char **argv);
     20int setsid_main(int argc, char **argv)
    2321{
    2422    if (argc < 2)
    2523        bb_show_usage();
    2624
    27     if (getpgrp() == getpid()) {
    28         switch(fork()){
    29         case -1:
    30             bb_perror_msg_and_die("fork");
    31         case 0:
    32             break;
    33         default:    /* parent */
    34             exit(0);
    35         }
    36         /* child falls through */
    37     }
     25    /* Comment why is this necessary? */
     26    if (getpgrp() == getpid())
     27        forkexit_or_rexec(argv);
    3828
    3929    setsid();  /* no error possible */
    4030
    41     execvp(argv[1], argv + 1);
    42 
     31    BB_EXECVP(argv[1], argv + 1);
    4332    bb_perror_msg_and_die("%s", argv[1]);
    4433}
Note: See TracChangeset for help on using the changeset viewer.