aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
blob: 953c2d17a99ff2e8004d4eeb2771dba5d7ef5723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# coreutils uses gnulib which conflicts with newer libc header on futimens
# this patch simply renames coreutils futimes to avoid confliction
#
# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
# (this patch is licensed under GPLv2)

diff --git a/lib/utimens.c b/lib/utimens.c
index 71bc510..ae870b8 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -75,7 +75,7 @@ struct utimbuf
    Return 0 on success, -1 (setting errno) on failure.  */
 
 int
-futimens (int fd ATTRIBUTE_UNUSED,
+futimens_coreutils (int fd ATTRIBUTE_UNUSED,
 	  char const *file, struct timespec const timespec[2])
 {
   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
 int
 utimens (char const *file, struct timespec const timespec[2])
 {
-  return futimens (-1, file, timespec);
+  return futimens_coreutils (-1, file, timespec);
 }
diff --git a/lib/utimens.h b/lib/utimens.h
index 0097aaa..13fc45a 100644
--- a/lib/utimens.h
+++ b/lib/utimens.h
@@ -1,3 +1,3 @@
 #include <time.h>
-int futimens (int, char const *, struct timespec const [2]);
+int futimens_coreutils (int, char const *, struct timespec const [2]);
 int utimens (char const *, struct timespec const [2]);
diff --git a/src/copy.c b/src/copy.c
index 4bdb75c..04634f1 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name,
       timespec[0] = get_stat_atime (src_sb);
       timespec[1] = get_stat_mtime (src_sb);
 
-      if (futimens (dest_desc, dst_name, timespec) != 0)
+      if (futimens_coreutils (dest_desc, dst_name, timespec) != 0)
 	{
 	  error (0, errno, _("preserving times for %s"), quote (dst_name));
 	  if (x->require_preserve)
diff --git a/src/touch.c b/src/touch.c
index a79c26d..6ef317d 100644
--- a/src/touch.c
+++ b/src/touch.c
@@ -182,7 +182,7 @@ touch (const char *file)
       t = timespec;
     }
 
-  ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
+  ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
 
   if (fd == STDIN_FILENO)
     {
/span> # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot # hack the extra indirection OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS) +OBJ_PIC = $(PSRC:.c=_pic.o) $(FSRC:.c=.o) $(CSRC:.c=_pic.o) $(GENSRC:.c=_pic.o) HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \ ethertype.h gencode.h gnuc.h GENHDR = \ @@ -95,15 +109,22 @@ TAGFILES = \ $(SRC) $(HDR) $(TAGHDR) -CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c +CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c libpcap.so* -all: libpcap.a +all: libpcap.a $(SHAREDLIB) libpcap.a: $(OBJ) @rm -f $@ ar rc $@ $(OBJ) $(LIBS) $(RANLIB) $@ +$(SHAREDLIB): $(OBJ_PIC) + -@rm -f $@ + -@rm -f $(SOLIBRARY) $(SOLIBRARY).$(MAJ) + $(CC) $(CFLAGS_SHARED) -o $(SHAREDLIB) $(OBJ_PIC) -lc + ln -s $(SHAREDLIB) $(SOLIBRARY).$(MAJ) + ln -s $(SOLIBRARY).$(MAJ) $(SOLIBRARY) + shared: libpcap.$(DYEXT) # @@ -129,6 +150,9 @@ scanner.o: scanner.c tokdefs.h $(CC) $(CFLAGS) -c scanner.c +scanner_pic.o: scanner.c tokdefs.h + $(CC) -fPIC $(CFLAGS) -o $@ -c scanner.c + pcap.o: version.h tokdefs.h: grammar.c @@ -142,9 +166,16 @@ @rm -f $@ $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c +grammer_pic.o: grammar.c + @rm -f $@ + $(CC) -fPIC $(CFLAGS) -Dyylval=pcap_lval -o $@ -c grammar.c + version.o: version.c $(CC) $(CFLAGS) -c version.c +version_pic.o: version.c + $(CC) -fPIC $(CFLAGS) -c version.c -o $@ + snprintf.o: $(srcdir)/missing/snprintf.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c @@ -170,11 +201,17 @@ bpf_filter.o: bpf_filter.c $(CC) $(CFLAGS) -c bpf_filter.c +bpf_filter_pic.o: bpf_filter.c + $(CC) -fPIC $(CFLAGS) -c bpf_filter.c -o $@ + install: libpcap.a [ -d $(DESTDIR)$(libdir) ] || \ (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a + $(INSTALL_DATA) $(SHAREDLIB) $(DESTDIR)$(libdir)/ + ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY).$(MAJ) + ln -sf $(SOLIBRARY).$(MAJ) $(DESTDIR)$(libdir)/$(SOLIBRARY) [ -d $(DESTDIR)$(includedir) ] || \ (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir)) $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h