bug-gnulib
[Top][All Lists]
Advanced

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

Re: flock fails on sparc-sun-solaris2.6


From: Simon Josefsson
Subject: Re: flock fails on sparc-sun-solaris2.6
Date: Thu, 18 Dec 2008 18:21:07 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

"Tom G. Christensen" <address@hidden> writes:

> depbase=`echo flock.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
>         gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" 
> -DNO_XMALLOC -DEXEEXT=\"\" -I. -I..  -I../intl -D_REENTRANT  -g -O2 -MT 
> flock.o -MD -MP -MF $depbase.Tpo -c -o flock.o flock.c &&\
>         mv -f $depbase.Tpo $depbase.Po
> flock.c: In function 'flock':
> flock.c:186: warning: implicit declaration of function 'memset'
> flock.c:186: warning: incompatible implicit declaration of built-in function 
> 'memset'
> flock.c:202: error: 'errno' undeclared (first use in this function)
> flock.c:202: error: (Each undeclared identifier is reported only once
> flock.c:202: error: for each function it appears in.)
> flock.c:202: error: 'EINVAL' undeclared (first use in this function)
> flock.c:207: error: 'EACCES' undeclared (first use in this function)
> flock.c:208: error: 'EAGAIN' undeclared (first use in this function)
> make[2]: *** [flock.o] Error 1
>
> Adding #include <errno.h> takes care of this error.

This one also seems simple.  Patch below.  Will push unless there are
objections.

> test-flock then fails like this:
> $ ./test-flock
> test-flock.c:72: assertion failed, errno = 22
> Abort (core dumped)

This suggests a deeper problem.  Unless someone debugs this, maybe at
least having it build will be good enough for some projects.

Thanks,
/Simon

2008-12-18  Simon Josefsson  <address@hidden>

        * lib/flock.c: Need to include errno.h.  Reported by "Tom
        G. Christensen" <address@hidden>.

diff --git a/lib/flock.c b/lib/flock.c
index 5aa7690..4db5004 100644
--- a/lib/flock.c
+++ b/lib/flock.c
@@ -171,6 +171,8 @@ flock (int fd, int operation)
 #include <unistd.h>
 #endif
 
+#include <errno.h>
+
 int
 flock (int fd, int operation)
 {




reply via email to

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