Subject: setsid(2) bug (correction)
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Christos Zoulas <christos@deshaw.com>
List: current-users
Date: 02/24/1994 11:40:20
I should have been more careful. The patch I posted before is not
needed. I got confused, because the following program worked under
SunOS (while it should not). It prints 'Operation not permitted'
correctly on NetBSD...
#include <stdio.h>
#include <unistd.h>
int
main(argc, argv)
int argc;
char *argv[];
{
if (argc == 1)
return 2;
if (setsid() == -1) {
perror("setsid");
exit(1);
}
execvp(argv[1], &argv[1]);
perror("execvp");
return 1;
}
------------------------------------------------------------------------------