This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via bb1be3426bfe3f98e00ba5d172bd779df084845e (commit)
via c60ccea5aa3fee31e21e32c4e4f6bebb782618cc (commit)
via 33e3dbe62c420cc1cdee09d60735d20b5eff9a3d (commit)
via 23e96d89b6ab0de3e857a865439b6e643617d0cf (commit)
from cb62dc41759f526e0ea8ed7c7ad8050a093ff827 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bb1be3426bfe3f98e00ba5d172bd779df084845e
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Aug 22 21:35:11 2015 +0200
bump version
commit c60ccea5aa3fee31e21e32c4e4f6bebb782618cc
Author: Romain Naour <romain.naour(a)openwide.fr>
Date: Sat Aug 22 21:08:36 2015 +0200
add tests for mkostemps()
Signed-off-by: Romain Naour <romain.naour(a)openwide.fr>
commit 33e3dbe62c420cc1cdee09d60735d20b5eff9a3d
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Aug 22 20:41:31 2015 +0200
quieten compile warnings
Sync with glibc, quietens gcc warnings.
commit 23e96d89b6ab0de3e857a865439b6e643617d0cf
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Aug 22 20:40:42 2015 +0200
ldso: install backward compatibility symlink by default
Simplify the switch from uClibc to uClibc-ng suggested
by Alexey Brodkin <Alexey.Brodkin(a)synopsys.com>om>.
Gcc always uses .0 ld.so link, so install it by default.
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 2 +-
ldso/ldso/Makefile.in | 2 +
libpthread/nptl/sysdeps/pthread/bits/libc-lock.h | 2 +-
libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h | 2 +-
test/misc/tst-mkostemps.c | 159 +++++++++++++++++++++
5 files changed, 164 insertions(+), 3 deletions(-)
create mode 100644 test/misc/tst-mkostemps.c
diff --git a/Rules.mak b/Rules.mak
index 4ca22b0..2cef9d9 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -126,7 +126,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR
# Now config hard core
MAJOR_VERSION := 1
MINOR_VERSION := 0
-SUBLEVEL := 5
+SUBLEVEL := 6
EXTRAVERSION :=
VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
ABI_VERSION := $(MAJOR_VERSION)
diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
index 424131c..ffbb5cc 100644
--- a/ldso/ldso/Makefile.in
+++ b/ldso/ldso/Makefile.in
@@ -74,6 +74,8 @@ $(ldso): $(ldso:.$(ABI_VERSION)=)
$(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
$(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
+ # link for backward compatibility
+ (cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION)
$(UCLIBC_LDSO_NAME).so.0 )
$($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
$(Q)$(RM) $@
diff --git a/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
b/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
index 4df507b..633021a 100644
--- a/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
+++ b/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
@@ -171,7 +171,7 @@ typedef pthread_key_t __libc_key_t;
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
-# define __libc_lock_init(NAME) ((NAME) = LLL_LOCK_INITIALIZER, 0)
+# define __libc_lock_init(NAME) ((void)((NAME) = LLL_LOCK_INITIALIZER))
#else
# define __libc_lock_init(NAME) \
__libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0)
diff --git a/libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h
b/libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h
index 5ad5d95..ae39b87 100644
--- a/libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h
+++ b/libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h
@@ -31,7 +31,7 @@ typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
#define _IO_lock_initializer { LLL_LOCK_INITIALIZER, 0, NULL }
#define _IO_lock_init(_name) \
- ((_name) = (_IO_lock_t) _IO_lock_initializer , 0)
+ ((void) ((_name) = (_IO_lock_t) _IO_lock_initializer))
#define _IO_lock_fini(_name) \
((void) 0)
diff --git a/test/misc/tst-mkostemps.c b/test/misc/tst-mkostemps.c
new file mode 100644
index 0000000..2f45bfd
--- /dev/null
+++ b/test/misc/tst-mkostemps.c
@@ -0,0 +1,159 @@
+/*
+ * Test application for mkstemp/mkstemps/mkostemp/mkostemps
+ * Copyright (C) 2015 by Romain Naour <romain.naour(a)openwide.fr>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#define assert(x) \
+ if (!(x)) \
+ { \
+ fputs ("test failed: " #x "\n", stderr); \
+ retval = 1; \
+ goto the_end; \
+ }
+
+int
+main (int argc, char *argv[])
+{
+ char name[256];
+ char name_suffix[256];
+ FILE *fp = NULL;
+ int retval = 0;
+ int fd;
+ int flags = O_RDONLY | O_CLOEXEC;
+ struct stat sb_f1;
+ struct stat sb_f2;
+
+ /* mkstemp test */
+ sprintf(name, "%s-uClibc-test.XXXXXX", __FILE__);
+
+ fd = mkstemp(name);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+
+ close(fd);
+ unlink (name);
+
+ /* mkstemps test */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX.txt", __FILE__);
+
+ fd = mkstemps(name_suffix, 4);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name_suffix, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+
+ close(fd);
+ unlink (name_suffix);
+
+ /* mkostemp test */
+ sprintf(name, "%s-uClibc-test.XXXXXX", __FILE__);
+
+ fd = mkostemp(name, flags);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+ assert (sb_f1.st_mode == sb_f2.st_mode)
+
+ close(fd);
+ unlink (name);
+
+ /* mkostemps test */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX.txt", __FILE__);
+
+ fd = mkostemps(name_suffix, 4, flags);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+ assert (sb_f1.st_mode == sb_f2.st_mode)
+
+ close(fd);
+ unlink (name_suffix);
+
+ /* suffixlen = 0 */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX", __FILE__);
+
+ fd = mkostemps(name_suffix, 0, flags);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+ assert (sb_f1.st_mode == sb_f2.st_mode)
+
+ close(fd);
+ unlink (name_suffix);
+
+ /* stress tests */
+
+ /* template len < 6 */
+ sprintf(name, "XXXXX");
+
+ fd = mkstemp(name);
+
+ assert(fd == -1);
+ assert(errno == EINVAL);
+
+ /* suffixlen < 0 */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX.txt", __FILE__);
+
+ fd = mkostemps(name_suffix, -1, flags);
+
+ assert(fd == -1);
+ assert(errno == EINVAL);
+
+ /* Missing one X */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXX.txt", __FILE__);
+
+ fd = mkostemps(name_suffix, 4, flags);
+
+ assert(fd == -1);
+ assert(errno == EINVAL);
+
+ /* wrong suffixlen */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX.txt", __FILE__);
+
+ fd = mkostemps(name_suffix, 2, flags);
+
+ assert(fd == -1);
+ assert(errno == EINVAL);
+
+the_end:
+ if (fp != NULL)
+ assert (fclose (fp) == 0);
+ unlink (name);
+ unlink (name_suffix);
+
+ return retval;
+}
hooks/post-receive
--
uClibc-ng - small C library for embedded systems