summaryrefslogtreecommitdiffstats
path: root/include/writeall.h
diff options
context:
space:
mode:
authorWerner Fink2011-05-09 15:52:35 +0200
committerKarel Zak2011-05-17 11:10:03 +0200
commit729def03e1cdc3520690ca8e512b0a0a5e9e7211 (patch)
treed05c7feb2121ea3bc7b023f1437fae1bcc12f65d /include/writeall.h
parentagetty: more code cleanup (diff)
downloadkernel-qcow2-util-linux-729def03e1cdc3520690ca8e512b0a0a5e9e7211.tar.gz
kernel-qcow2-util-linux-729def03e1cdc3520690ca8e512b0a0a5e9e7211.tar.xz
kernel-qcow2-util-linux-729def03e1cdc3520690ca8e512b0a0a5e9e7211.zip
agetty: cleanup argv parsing, utmp update, use writeall(), etc.
Next cleanup, that is split off special character parsing in do_prompt() and parse_args(), handle name of line of virtual console and use it in utmp update as well as the session id. Also move the initial TERM variable to open_tty() as we use this later in open_tty(). Use writeall() but avoid repeat to often for EAGAIN (compare with info page of the (g)libc, description of the macro EAGAIN). Signed-off-by: Werner Fink <werner@suse.de>
Diffstat (limited to 'include/writeall.h')
-rw-r--r--include/writeall.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/writeall.h b/include/writeall.h
index a04496d8f..20207076d 100644
--- a/include/writeall.h
+++ b/include/writeall.h
@@ -18,6 +18,8 @@ static inline int write_all(int fd, const void *buf, size_t count)
buf += tmp;
} else if (errno != EINTR && errno != EAGAIN)
return -1;
+ if (errno == EAGAIN) /* Try later, *sigh* */
+ usleep(10000);
}
return 0;
}