Changeset 3012 for branches/libc-0.6/src/emx
- Timestamp:
- Apr 7, 2007, 6:29:36 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/src/lib/io/_tempnam.c
r1454 r3012 11 11 #include <io.h> 12 12 #include <errno.h> 13 #include <sys/stat.h> 13 14 #include <sys/param.h> 14 15 #include <emx/io.h> 15 #include <emx/syscalls.h>16 16 #include "_tmp.h" 17 17 … … 22 22 static int _isdir (char *dst, const char *src) 23 23 { 24 int attr;24 struct stat s; 25 25 26 26 if (_fullpath (dst, src, MAXPATHLEN) != 0) 27 27 return 0; 28 attr = __chmod (dst, 0, 0);29 return attr >= 0 && (attr & _A_SUBDIR);28 return lstat (dst, &s) == 0 29 && S_ISDIR(s.st_mode); 30 30 } 31 31 … … 59 59 tmpname[len++] = '/'; 60 60 p = tmpname + len; 61 62 if (!prefix) 63 prefix = "kLC"; 61 64 62 65 TMPIDX_LOCK; … … 98 101 free (tmpname); 99 102 p = strdup (buf); 100 if (p == NULL) 103 if (p != NULL) 104 errno = saved_errno; 105 else 101 106 errno = ENOMEM; 102 107 return p;
Note:
See TracChangeset
for help on using the changeset viewer.