]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools: s/read()/lxc_read_nointr()/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 29 Jul 2018 21:56:33 +0000 (23:56 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 29 Jul 2018 22:16:31 +0000 (00:16 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/tools/lxc_destroy.c
src/lxc/tools/lxc_monitor.c
src/lxc/tools/lxc_top.c
src/lxc/tools/lxc_unshare.c

index 35514689f0fb96656de08d6951f7232e204b2a3a..e208cf6fd42d40a8f4ffac78760225bac7d08756 100644 (file)
@@ -233,14 +233,13 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
                        return false;
                }
 
-               ret = read(fd, buf, fbuf.st_size);
+               ret = lxc_read_nointr(fd, buf, fbuf.st_size);
+               close(fd);
                if (ret < 0) {
                        ERROR("Could not read %s", path);
-                       close(fd);
                        free(buf);
                        return false;
                }
-               close(fd);
 
                lxc_iterate_parts(lxcpath, buf, "\n") {
                        c1 = lxc_container_new(lxcname, lxcpath);
index abeccdeedac52c96f88426690d59c79d595118cc..525b296ccf1439f68f9bc0eeae4c378b9561606b 100644 (file)
@@ -202,7 +202,7 @@ static int lxc_tool_monitord_spawn(const char *lxcpath)
                 * synced with the child process. the if-empty-statement
                 * construct is to quiet the warn-unused-result warning.
                 */
-               if (read(pipefd[0], &c, 1))
+               if (lxc_read_nointr(pipefd[0], &c, 1))
                        ;
 
                close(pipefd[0]);
index b873be640ed36894c46ab5e56f561830984cb1b3..0ffc65e6f54cc2320d820e1ed639c3144c8e0e64 100644 (file)
@@ -574,7 +574,7 @@ static int stdin_handler(int fd, uint32_t events, void *data,
        if (events & EPOLLIN) {
                int rc;
 
-               rc = read(fd, in_char, sizeof(*in_char));
+               rc = lxc_read_nointr(fd, in_char, sizeof(*in_char));
                if (rc <= 0)
                        *in_char = '\0';
        }
index 720ecb3783ea2aa0466d8df576ff1f1ba5c8414f..fa529b9cfa5c717b517faf01f5b52fa644c3d14e 100644 (file)
@@ -271,7 +271,7 @@ static int do_start(void *arg)
 
        if (start_arg->setuid) {
                /* waiting until uid maps is set */
-               ret = read(start_arg->wait_fd, &wait_val, sizeof(wait_val));
+               ret = lxc_read_nointr(start_arg->wait_fd, &wait_val, sizeof(wait_val));
                if (ret == -1) {
                        SYSERROR("Failed to read eventfd");
                        close(start_arg->wait_fd);