ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/lib/pidfile.c
(Generate patch)

Comparing gvpe/lib/pidfile.c (file contents):
Revision 1.1 by pcg, Sat Mar 1 15:53:02 2003 UTC vs.
Revision 1.2 by pcg, Mon May 10 19:25:30 2004 UTC

91 int fd; 91 int fd;
92 int pid; 92 int pid;
93 93
94 if ( ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1) 94 if ( ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1)
95 || ((f = fdopen(fd, "r+")) == NULL) ) { 95 || ((f = fdopen(fd, "r+")) == NULL) ) {
96 fprintf(stderr, "Can't open or create %s.\n", pidfile); 96 fprintf(stderr, "Can't open or create %s.\n", pidfile ? pidfile : "(null)");
97 return 0; 97 return 0;
98 } 98 }
99 99
100#ifdef HAVE_FLOCK 100#ifdef HAVE_FLOCK
101 if (flock(fd, LOCK_EX|LOCK_NB) == -1) { 101 if (flock(fd, LOCK_EX|LOCK_NB) == -1) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines