diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-05-11 16:42:16 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-05-11 16:42:16 +0000 |
commit | 75a5b947e1658ee3a1b67e4b7cf27b1da8da2a8c (patch) | |
tree | bf68a3f9cdda94bae7c1d28a5384f26406910d7f /sys/arch/zaurus/stand | |
parent | 91fa891d55242fc57e2b3da12a2cec08ff8be83b (diff) |
prettier; ok uwe
Diffstat (limited to 'sys/arch/zaurus/stand')
-rw-r--r-- | sys/arch/zaurus/stand/zboot/cmd.c | 47 | ||||
-rw-r--r-- | sys/arch/zaurus/stand/zboot/devopen.c | 9 | ||||
-rw-r--r-- | sys/arch/zaurus/stand/zboot/machdep.c | 6 |
3 files changed, 29 insertions, 33 deletions
diff --git a/sys/arch/zaurus/stand/zboot/cmd.c b/sys/arch/zaurus/stand/zboot/cmd.c index 18205f361c4..028eaa8920c 100644 --- a/sys/arch/zaurus/stand/zboot/cmd.c +++ b/sys/arch/zaurus/stand/zboot/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.1 2005/04/16 17:23:34 uwe Exp $ */ +/* $OpenBSD: cmd.c,v 1.2 2005/05/11 16:42:15 deraadt Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -124,7 +124,6 @@ read_conf(void) char *p = cmd_buf; cmd.cmd = NULL; - do { rc = read(fd, p, 1); } while (rc > 0 && *p++ != '\n' && @@ -150,10 +149,8 @@ read_conf(void) /* Don't want to run the truncated command */ rc = -1; } - *p = '\0'; } - } while (rc > 0 && !(rc = docmd())); close(fd); @@ -385,25 +382,25 @@ Xstty(void) char *cp; dev_t dev; - if (cmd.argc == 1) + if (cmd.argc == 1) { printf("%s speed is %d\n", ttyname(0), cnspeed(0, -1)); - else { - dev = ttydev(cmd.argv[1]); - if (dev == NODEV) - printf("%s not a console device\n", cmd.argv[1]); - else { - if (cmd.argc == 2) - printf("%s speed is %d\n", cmd.argv[1], - cnspeed(dev, -1)); - else { - sp = 0; - for (cp = cmd.argv[2]; *cp && isdigit(*cp); cp++) - sp = sp * 10 + (*cp - '0'); - cnspeed(dev, sp); - } - } + return 0; + } + dev = ttydev(cmd.argv[1]); + if (dev == NODEV) { + printf("%s not a console device\n", cmd.argv[1]); + return 0; } + if (cmd.argc == 2) + printf("%s speed is %d\n", cmd.argv[1], + cnspeed(dev, -1)); + else { + sp = 0; + for (cp = cmd.argv[2]; *cp && isdigit(*cp); cp++) + sp = sp * 10 + (*cp - '0'); + cnspeed(dev, sp); + } return 0; } @@ -414,8 +411,6 @@ Xtime(void) if (cmd.argc == 1) printf(ctime(&tt)); - else { - } return 0; } @@ -436,8 +431,8 @@ Xls(void) ls(cmd.path, &sb); else { if ((fd = opendir(cmd.path)) < 0) { - printf ("opendir(%s): %s\n", cmd.path, - strerror(errno)); + printf("opendir(%s): %s\n", cmd.path, + strerror(errno)); return 0; } @@ -447,10 +442,10 @@ Xls(void) *p++ = '/'; *p = '\0'; - while(readdir(fd, p) >= 0) { + while (readdir(fd, p) >= 0) { if (stat(cmd.path, &sb) < 0) printf("stat(%s): %s\n", cmd.path, - strerror(errno)); + strerror(errno)); else ls(p, &sb); } diff --git a/sys/arch/zaurus/stand/zboot/devopen.c b/sys/arch/zaurus/stand/zboot/devopen.c index 4d348700183..1acbb1a03cb 100644 --- a/sys/arch/zaurus/stand/zboot/devopen.c +++ b/sys/arch/zaurus/stand/zboot/devopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devopen.c,v 1.2 2005/04/16 17:27:58 uwe Exp $ */ +/* $OpenBSD: devopen.c,v 1.3 2005/05/11 16:42:15 deraadt Exp $ */ /* * Copyright (c) 1996-1999 Michael Shalayeff @@ -118,15 +118,18 @@ getbootdev(dev_t bootdev, char *p) */ if ((fd = uopen(s, O_RDONLY)) == -1 && errno == ENXIO) { int t; + while (fd == -1 && timeout > 0) { timeout--; t = getsecs() + 1; - while (getsecs() < t); + while (getsecs() < t) + ; fd = uopen(s, O_RDONLY); } if (fd != -1) { t = getsecs() + 2; - while (getsecs() < t); + while (getsecs() < t) + ; } } if (fd == -1) diff --git a/sys/arch/zaurus/stand/zboot/machdep.c b/sys/arch/zaurus/stand/zboot/machdep.c index a8db8cb0dd5..7e7501e6c61 100644 --- a/sys/arch/zaurus/stand/zboot/machdep.c +++ b/sys/arch/zaurus/stand/zboot/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.1 2005/01/10 00:25:03 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.2 2005/05/11 16:42:15 deraadt Exp $ */ /* * Copyright (c) 2004 Tom Cosgrove @@ -47,10 +47,8 @@ machdep(void) if (pr != NULL) { printf("%s: ", pr->name); - for (j = 0; j < pr->count; j++) { + for (j = 0; j < pr->count; j++) (*(pr->probes)[j])(); - } - printf("\n"); } } |