summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-12-21 11:17:20 +0000
committerJim Meyering <jim@meyering.net>1997-12-21 11:17:20 +0000
commit27d24b46ad376fc3bcdadaedfaf086d977584e7d (patch)
treed2658cd19142f16ac4712eff71e43eab55f01c6e /lib
parenta2f0f9ac89fc3656fb5fb2806a0a2bc31f84b901 (diff)
downloadcoreutils-27d24b46ad376fc3bcdadaedfaf086d977584e7d.tar.xz
(rpl_chown): Rename from chown.
Undefine chown just after including config.h. Include sys/stat.h. Use correct ordering of uid and gid parameters both in function definition and in call to chown. With patches from Kaveh Ghazi.
Diffstat (limited to 'lib')
-rw-r--r--lib/chown.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/chown.c b/lib/chown.c
index 1d3346d36..dc351d28c 100644
--- a/lib/chown.c
+++ b/lib/chown.c
@@ -19,7 +19,14 @@
/* written by Jim Meyering */
#include <config.h>
+
+/* Disable the definition of chown to rpl_chown (from config.h) in this
+ file. Otherwise, we'd get conflicting prototypes for rpl_chown on
+ most systems. */
+#undef chown
+
#include <sys/types.h>
+#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -27,10 +34,10 @@
/* FIXME: describe. */
int
-chown (file, gid, uid)
+rpl_chown (file, uid, gid)
const char *file;
- gid_t git;
- uid_t uit;
+ uid_t uid;
+ gid_t gid;
{
if (gid == (gid_t) -1 || uid == (uid_t) -1)
{
@@ -47,7 +54,5 @@ chown (file, gid, uid)
uid = file_stats.st_uid;
}
-#undef chown
-
- return chown (file, gid, uid);
+ return chown (file, uid, gid);
}