diff options
author | Mike Smith <msmith@FreeBSD.org> | 1998-10-31 02:48:29 +0000 |
---|---|---|
committer | Mike Smith <msmith@FreeBSD.org> | 1998-10-31 02:48:29 +0000 |
commit | 2baf3bb5a02e424dc38b6b9f9ce0969e040e313f (patch) | |
tree | ac7c96b5e31f0f243f61999ac7dfdcfb642b3ded /lib/libstand/gets.c | |
parent | 65f14a74bd68f17899ee3d27c2cd13108ba73616 (diff) | |
download | src-2baf3bb5a02e424dc38b6b9f9ce0969e040e313f.tar.gz src-2baf3bb5a02e424dc38b6b9f9ce0969e040e313f.zip |
Add a new field to the devsw structure; dv_print, to print all valid units
etc. associated with the device entry.
Consider EOF an 'error' for fgetstr if we haven't read anything yet.
You *MUST* recompile and reinstall libstand before rebuilding the bootstrap.
Notes
Notes:
svn path=/head/; revision=40774
Diffstat (limited to 'lib/libstand/gets.c')
-rw-r--r-- | lib/libstand/gets.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libstand/gets.c b/lib/libstand/gets.c index 3fbe9b4047a3..dc26a998b325 100644 --- a/lib/libstand/gets.c +++ b/lib/libstand/gets.c @@ -95,8 +95,11 @@ fgetstr(char *buf, int size, int fd) err = read(fd, &c, sizeof(c)); if (err < 0) /* read error */ return(-1); - if (err == 0) /* EOF */ + if (err == 0) { /* EOF */ + if (len == 0) + return(-1); /* nothing to read */ break; + } if ((c == '\r') || /* line terminators */ (c == '\n')) break; |