Update of /cvsroot/dhcp-agent/dhcp-agent/src
In directory sc8-pr-cvs1:/tmp/cvs-serv3931
Modified Files:
dhcp-client.c
Log Message:
correctly gives error for work_directory problems
Index: dhcp-client.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** dhcp-client.c 21 Dec 2002 16:17:52 -0000 1.14
--- dhcp-client.c 21 Dec 2002 17:13:14 -0000 1.15
***************
*** 337,356 ****
/* Switch into our work directory */
- if(chdir(work_dir) < 0) {
! /* If it isn't there create it.
! * Since we're not setuid we
! * assume the root user knows what he's
! * doing and that it's
! * safe to create this directory.
! *
! */
if(mkdir(work_dir, S_IRWXU) < 0)
FATAL_MESSAGE("cannot create work directory", strerror(errno));
-
- if(chdir(work_dir) < 0)
- FATAL_MESSAGE("cannot enter work directory", work_dir);
}
return;
--- 337,357 ----
/* Switch into our work directory */
! /* If it isn't there create it.
! * Since we're not setuid we
! * assume the root user knows what he's
! * doing and that it's
! * safe to create this directory.
! *
! */
!
! if(!file_exists(work_dir)) {
if(mkdir(work_dir, S_IRWXU) < 0)
FATAL_MESSAGE("cannot create work directory", strerror(errno));
}
+
+ if(chdir(work_dir) < 0)
+ FATAL_MESSAGE("cannot enter work directory", work_dir);
return;
|