[Libsysio-commit] HEAD: libsysio/src chdir.c
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2003-10-24 18:00:46
|
Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv27145
Modified Files:
chdir.c
Log Message:
It's a bad idea to return -EFAULT from a function that returns pointers. Now
set errno to EFAULT and return NULL in getwd().
Index: chdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -b -B -p -r1.8 -r1.9
--- chdir.c 15 Oct 2003 19:21:37 -0000 1.8
+++ chdir.c 24 Oct 2003 17:59:18 -0000 1.9
@@ -248,8 +248,10 @@ char *
getwd(char *buf)
{
- if (!buf)
- return -EFAULT;
+ if (!buf) {
+ errno = EFAULT;
+ return NULL;
+ }
return getcwd(buf, PATH_MAX);
}
|