delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/02/03/05:51:15

Date: Mon, 03 Feb 2003 10:52:53 +0000
From: "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
Sender: rich AT phekda DOT freeserve DOT co DOT uk
To: djgpp-workers AT delorie DOT com
X-Mailer: Emacs 21.3.50 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
Subject: fchown return code wrong [PATCH]
Message-Id: <E18feBi-0000UA-00@phekda.freeserve.co.uk>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

fchown is supposed to return -1 on failure. Below is a patch
to make it do that.

If there are no objections, I will commit this patch at the weekend.

Bye, Rich =]

Index: src/libc/compat/unistd/fchown.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/compat/unistd/fchown.c,v
retrieving revision 1.2
diff -p -u -3 -r1.2 fchown.c
--- src/libc/compat/unistd/fchown.c	14 Jun 2002 14:24:39 -0000	1.2
+++ src/libc/compat/unistd/fchown.c	3 Feb 2003 10:49:49 -0000
@@ -1,3 +1,4 @@
+/* Copyright (C) 2003 DJ Delorie, see COPYING.DJ for details */
 /* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */
 #include <libc/stubs.h>
 #include <stdarg.h>
@@ -18,5 +19,5 @@ int fchown(int fd, uid_t owner, gid_t gr
     if (__FSEXT_func_wrapper(func, __FSEXT_fchown, &rv, fd, owner, group))
       return rv;
   }
-  return (_get_dev_info(fd) == -1) ? 1 : 0;
+  return (_get_dev_info(fd) == -1) ? -1 : 0;
 }

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019