Fix some compiler warnings emitted by gcc-4.8.0
[oweals/busybox.git] / miscutils / wall.c
index c74f4f27b6627fe04ad2c9866a06960664056698..bb709ee39e8d3697d36d4196b61618c35976675b 100644 (file)
@@ -41,11 +41,7 @@ int wall_main(int argc UNUSED_PARAM, char **argv)
                /* The applet is setuid.
                 * Access to the file must be under user's uid/gid.
                 */
-               setfsuid(getuid());
-               setfsgid(getgid());
-               fd = xopen(argv[1], O_RDONLY);
-               setfsuid(geteuid());
-               setfsgid(getegid());
+               fd = xopen_as_uid_gid(argv[1], O_RDONLY, getuid(), getgid());
        }
        msg = xmalloc_read(fd, NULL);
        if (ENABLE_FEATURE_CLEAN_UP && argv[1])