[haiku-commits] r34292 - haiku/trunk/src/system/libroot/posix/unistd

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 26 Nov 2009 17:58:36 +0100 (CET)

Author: axeld
Date: 2009-11-26 17:58:36 +0100 (Thu, 26 Nov 2009)
New Revision: 34292
Changeset: http://dev.haiku-os.org/changeset/34292/haiku

Modified:
   haiku/trunk/src/system/libroot/posix/unistd/directory.c
Log:
* Minor cleanup.


Modified: haiku/trunk/src/system/libroot/posix/unistd/directory.c
===================================================================
--- haiku/trunk/src/system/libroot/posix/unistd/directory.c     2009-11-26 
16:38:54 UTC (rev 34291)
+++ haiku/trunk/src/system/libroot/posix/unistd/directory.c     2009-11-26 
16:58:36 UTC (rev 34292)
@@ -1,39 +1,28 @@
 /*
- * Copyright 2002-2006, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx All rights 
reserved.
+ * Copyright 2002-2009, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx
  * Distributed under the terms of the MIT License.
  */
 
 
-#include <syscalls.h>
-
-#include <unistd.h>
-#include <stdlib.h>
 #include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
 
+#include <syscalls.h>
+#include <syscall_utils.h>
 
-#define RETURN_AND_SET_ERRNO(err) \
-       if (err < 0) { \
-               errno = err; \
-               return -1; \
-       } \
-       return err;
 
-
 int 
 chdir(const char *path)
 {
-       int status = _kern_setcwd(-1, path);
-
-       RETURN_AND_SET_ERRNO(status);
+       RETURN_AND_SET_ERRNO(_kern_setcwd(-1, path));
 }
 
 
 int 
 fchdir(int fd)
 {
-       int status = _kern_setcwd(fd, NULL);
-
-       RETURN_AND_SET_ERRNO(status);
+       RETURN_AND_SET_ERRNO(_kern_setcwd(fd, NULL));
 }
 
 
@@ -68,8 +57,6 @@
 int
 rmdir(const char *path)
 {
-       int status = _kern_remove_dir(-1, path);
-
-       RETURN_AND_SET_ERRNO(status);
+       RETURN_AND_SET_ERRNO(_kern_remove_dir(-1, path));
 }
 


Other related posts:

  • » [haiku-commits] r34292 - haiku/trunk/src/system/libroot/posix/unistd - axeld