bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unlinkat on hurd?


From: Simon Josefsson
Subject: unlinkat on hurd?
Date: Fri, 05 Aug 2011 13:28:28 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux)

According to [1] unlinkat.c is built on Hurd, and complains about
missing stdlib.h include:

unlinkat.c: In function 'rpl_unlinkat':
unlinkat.c:70:15: warning: implicit declaration of function 'free' 
[-Wimplicit-function-declaration]
unlinkat.c:70:15: warning: incompatible implicit declaration of built-in 
function 'free' [enabled by default]
unlinkat.c:74:11: warning: incompatible implicit declaration of built-in 
function 'free' [enabled by default]

However reading unlinkat.c the comments says it is for Solaris:

/* Work around unlinkat bugs on Solaris 9.

It seems in openat.m4 that Hurd is affected too, so I pushed the patch
below.

/Simon

[1] http://autobuild.josefsson.org/gnulib/log-201108051110526221000.txt

>From fc1861afb83184cfb975428a9710e90aa3252854 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Fri, 5 Aug 2011 13:27:17 +0200
Subject: [PATCH] openat: Fix warnings and commens when building unlinkat.c on 
Hurd.

* lib/unlinkat.c: Mention Hurd in comments.  Include stdlib.h to
get prototype for free.
---
 ChangeLog      |    6 ++++++
 lib/unlinkat.c |    7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 57b1110..3e4c1a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-05  Simon Josefsson  <address@hidden>
+
+       openat: Fix warnings and commens when building unlinkat.c on Hurd.
+       * lib/unlinkat.c: Mention Hurd in comments.  Include stdlib.h to
+       get prototype for free.
+
 2011-08-04  Bruno Haible  <address@hidden>
 
        Tests for module 'pathmax'.
diff --git a/lib/unlinkat.c b/lib/unlinkat.c
index fd1c69e..bae6642 100644
--- a/lib/unlinkat.c
+++ b/lib/unlinkat.c
@@ -1,4 +1,4 @@
-/* Work around unlinkat bugs on Solaris 9.
+/* Work around unlinkat bugs on Solaris 9 and Hurd.
 
    Copyright (C) 2009-2011 Free Software Foundation, Inc.
 
@@ -26,6 +26,8 @@
 #include <string.h>
 #include <sys/stat.h>
 
+#include <stdlib.h>
+
 #include "dosname.h"
 #include "openat.h"
 
@@ -34,7 +36,8 @@
 # undef unlinkat
 
 /* unlinkat without AT_REMOVEDIR does not honor trailing / on Solaris
-   9.  Solve it in a similar manner to unlink.  */
+   9.  Solve it in a similar manner to unlink.  Hurd has the same
+   issue. */
 
 int
 rpl_unlinkat (int fd, char const *name, int flag)
-- 
1.7.2.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]