]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
[BZ #2172]
authorRoland McGrath <roland@gnu.org>
Thu, 23 Feb 2006 22:50:36 +0000 (22:50 +0000)
committerRoland McGrath <roland@gnu.org>
Thu, 23 Feb 2006 22:50:36 +0000 (22:50 +0000)
* sysdeps/unix/sysv/linux/i386/fchownat.c: Diddle code so that "fail"
label is always used.

[BZ #2172]
* bits/syslog-path.h: New file.
* misc/Makefile (headers): Add it.
* misc/sys/syslog.h: Include it.
(_PATH_LOG): Macro removed.
From Robert Millan <robertmh@gnu.org>.

ChangeLog
bits/syslog-path.h [new file with mode: 0644]
misc/Makefile
misc/sys/syslog.h
sysdeps/unix/sysv/linux/i386/fchownat.c

index b54a2d9980f1be38741de02cad2f68d00af73c89..d71801071bf68cbb7976c0f68e107427606ea1be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2006-02-23  Roland McGrath  <roland@redhat.com>
 
+       * sysdeps/unix/sysv/linux/i386/fchownat.c: Diddle code so that "fail"
+       label is always used.
+
+       [BZ #2172]
+       * bits/syslog-path.h: New file.
+       * misc/Makefile (headers): Add it.
+       * misc/sys/syslog.h: Include it.
+       (_PATH_LOG): Macro removed.
+       From Robert Millan <robertmh@gnu.org>.
+
        * sysdeps/unix/sysv/linux/ftruncate64.c: Find generic implementation
        in misc/, not posix/.
        Reported by David S. Miller <davem@davemloft.net>.
diff --git a/bits/syslog-path.h b/bits/syslog-path.h
new file mode 100644 (file)
index 0000000..a1bbd6b
--- /dev/null
@@ -0,0 +1,29 @@
+/* <bits/syslog-path.h> -- _PATH_LOG definition
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_SYSLOG_H
+# error "Never include this file directly.  Use <sys/syslog.h> instead"
+#endif
+
+#ifndef _BITS_SYSLOG_PATH_H
+#define _BITS_SYSLOG_PATH_H 1
+
+#define        _PATH_LOG       "/dev/log"
+
+#endif /* bits/syslog-path.h */
index 7d60baa7d68471d1ce0be9752bc247d73a13b97f..63b6d413b3ea34236d09f459049fda8390fc5b16 100644 (file)
@@ -30,7 +30,8 @@ headers       := sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \
           sys/queue.h sysexits.h syscall.h sys/syscall.h sys/swap.h \
           sys/select.h ustat.h sys/ustat.h bits/ustat.h sys/sysinfo.h \
           regexp.h bits/select.h bits/mman.h sys/xattr.h \
-          syslog.h sys/syslog.h bits/syslog.h bits/syslog-ldbl.h
+          syslog.h sys/syslog.h \
+          bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h
 
 routines := brk sbrk sstk ioctl \
            readv writev \
index 0bc5b8d677cf5d81632adb4b44a4bcd9fd578d10..4ed57c2787e6417246d64aeb98856e7b9756f4b8 100644 (file)
@@ -36,8 +36,8 @@
 #define __need___va_list
 #include <stdarg.h>
 
-
-#define        _PATH_LOG       "/dev/log"
+/* This file defines _PATH_LOG.  */
+#include <bits/syslog-path.h>
 
 /*
  * priorities/facilities are encoded into a single 32-bit quantity, where the
index b2bac1913f6841dceb5d1f50559c4a4d29df41d9..e5306db6ee39a97fe4de3e9330948dc26cb440cf 100644 (file)
@@ -168,11 +168,11 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
 #endif
 
   if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
-    {
-    fail:
-      __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
-      result = -1;
-    }
+    goto fail;
 
   return result;
+
+ fail:
+  __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
+  return -1;
 }