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 | |
parent | 65f14a74bd68f17899ee3d27c2cd13108ba73616 (diff) |
Notes
-rw-r--r-- | lib/libstand/dev_net.c | 13 | ||||
-rw-r--r-- | lib/libstand/gets.c | 5 | ||||
-rw-r--r-- | lib/libstand/stand.h | 3 |
3 files changed, 19 insertions, 2 deletions
diff --git a/lib/libstand/dev_net.c b/lib/libstand/dev_net.c index 8d09e4f7c084..cfa9fbff8a94 100644 --- a/lib/libstand/dev_net.c +++ b/lib/libstand/dev_net.c @@ -73,6 +73,8 @@ static int netdev_opens; static int net_getparams(int sock); +static void net_print(int verbose); + struct devsw netdev = { "net", DEVT_NET, @@ -81,9 +83,20 @@ struct devsw netdev = { net_open, net_close, noioctl + net_print, }; /* + * Print stuff about our net 'device'. + */ +static void +net_print(int verbose) +{ + pager_output(" net: network interface"); + /* XXX much more verbose stuff here */ +} + +/* * Called by devopen after it sets f->f_dev to our devsw entry. * This opens the low-level device and sets f->f_devdata. * This is declared with variable arguments... 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; diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 251e7e8de124..3a054900d8ad 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: stand.h,v 1.7 1998/10/06 19:23:57 msmith Exp $ + * $Id: stand.h,v 1.8 1998/10/19 09:08:40 dfr Exp $ * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ */ @@ -137,6 +137,7 @@ struct devsw { int (*dv_open)(struct open_file *f, ...); int (*dv_close)(struct open_file *f); int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); + void (*dv_print)(int verbose); /* print device information */ }; extern int errno; |