/[cvs]/ccvs/lib/save-cwd.c
ViewVC logotype

Diff of /ccvs/lib/save-cwd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by dprice, Mon Sep 19 21:26:14 2005 UTC revision 1.12 by dprice, Tue Oct 4 02:34:54 2005 UTC
# Line 25  Line 25 
25    
26  #include "save-cwd.h"  #include "save-cwd.h"
27    
28    #include <errno.h>
29  #include <stdbool.h>  #include <stdbool.h>
30  #include <stdio.h>  #include <stdio.h>
31  #include <stdlib.h>  #include <stdlib.h>
32    #include <unistd.h>
 #if HAVE_UNISTD_H  
 # include <unistd.h>  
 #endif  
   
 #include <fcntl.h>  
   
 #include <errno.h>  
33    
34  #include "chdir-long.h"  #include "chdir-long.h"
35  #include "unistd-safer.h"  #include "fcntl--.h"
36  #include "xgetcwd.h"  #include "xgetcwd.h"
37    
38  /* On systems without the fchdir function (WOE), pretend that open  /* On systems without the fchdir function (WOE), pretend that open
# Line 78  save_cwd (struct saved_cwd *cwd) Line 72  save_cwd (struct saved_cwd *cwd)
72  {  {
73    cwd->name = NULL;    cwd->name = NULL;
74    
75    cwd->desc = fd_safer (open (".", O_RDONLY));    cwd->desc = open (".", O_RDONLY);
76    if (cwd->desc < 0)    if (cwd->desc < 0)
77      {      {
78        cwd->desc = fd_safer (open (".", O_WRONLY));        cwd->desc = open (".", O_WRONLY);
79        if (cwd->desc < 0)        if (cwd->desc < 0)
80          {          {
81            cwd->name = xgetcwd ();            cwd->name = xgetcwd ();

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26