On 2015-10-21 01:34, Daniel Golle wrote: > Hi! > > This has been an argument going on between the gcc and the glibc people > for about 10 years now. > See > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 > > It seems like commit b6618ffa which added the symlinks silently broke > things when building with glibc. > Don't ask me why glibc enabled warn_unused_result for symlink(3) but > doesn't for found mount(2) or mkdir(3)... > > A way around it would be to take things as they are and simply make > sure to surpress the warning as shown in > http://www.redhat.com/archives/rhl-devel-list/2007-March/msg00692.html > > Please try the following patch on procd and see if that helps 'fixing' > the unused-return-value warning: > --- > diff --git a/initd/early.c b/initd/early.c > index f410256..f82ce54 100644 > --- a/initd/early.c > +++ b/initd/early.c > @@ -66,7 +66,7 @@ early_mounts(void) > mount("sysfs", "/sys", "sysfs", MS_NOATIME | MS_NODEV | MS_NOEXEC | > MS_NOSUID, 0); > mount("cgroup", "/sys/fs/cgroup", "cgroup", MS_NODEV | MS_NOEXEC | > MS_NOSUID, 0); > mount("tmpfs", "/dev", "tmpfs", MS_NOATIME | MS_NOSUID, > "mode=0755,size=512K"); > - symlink("/tmp/shm", "/dev/shm"); > + ignore(symlink("/tmp/shm", "/dev/shm")); > mkdir("/dev/pts", 0755); > mount("devpts", "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | > MS_NOSUID, "mode=600"); > early_dev(); > diff --git a/plug/coldplug.c b/plug/coldplug.c > index 123e17d..74e345d 100644 > --- a/plug/coldplug.c > +++ b/plug/coldplug.c > @@ -45,7 +45,7 @@ void procd_coldplug(void) > umount2("/dev/pts", MNT_DETACH); > umount2("/dev/", MNT_DETACH); > mount("tmpfs", "/dev", "tmpfs", MS_NOSUID, "mode=0755,size=512K"); > - symlink("/tmp/shm", "/dev/shm"); > + ignore(symlink("/tmp/shm", "/dev/shm")); > mkdir("/dev/pts", 0755); > umask(oldumask); > mount("devpts", "/dev/pts", "devpts", MS_NOEXEC | MS_NOSUID, 0); > diff --git a/procd.h b/procd.h > index 66d183c..204a2bb 100644 > --- a/procd.h > +++ b/procd.h > @@ -56,4 +56,5 @@ void watch_add(const char *_name, void *id); > void watch_del(void *id); > void watch_ubus(struct ubus_context *ctx); > > +inline __attribute__((always_inline)) int ignore(int x) {return x;} inline functions should be static. the always_inline part is irrelevant here.
- Felix _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel