fa.openbsd.tech
[Top] [All Lists]

Re: bin/date diff

Subject: Re: bin/date diff
From: Gleydson Soares <gsoares@xxxxxxxxx>
Date: Fri, 25 Jul 2008 20:40:52 UTC
Newsgroups: fa.openbsd.tech

On Fri, Jul 25, 2008 at 5:22 PM, Ted Unangst <ted.unangst@xxxxxxxxx> wrote:
> This looks really funny.
>

ted :)
if (friday)
        beer++;
diff update bellow,
Index: netdate.c
===================================================================
RCS file: /cvs/src/bin/date/netdate.c,v
retrieving revision 1.16
diff -u -r1.16 netdate.c
--- netdate.c   25 Apr 2006 15:41:07 -0000      1.16
+++ netdate.c   25 Jul 2008 20:30:09 -0000
@@ -103,10 +103,9 @@
        memset(&sin, 0, sizeof(sin));
        sin.sin_len = sizeof(struct sockaddr_in);
        sin.sin_family = AF_INET;
-       if (bindresvport(s, &sin) < 0) {
-               warnx("all ports in use");
-               goto bad;
-       }
+       if (bindresvport(s, &sin) < 0)
+               err(1, "bindresvport");
+       
        msg.tsp_type = TSP_SETDATE;
        msg.tsp_vers = TSPVERSION;
        if (gethostname(hostname, sizeof(hostname))) {
Index: date.c
===================================================================
RCS file: /cvs/src/bin/date/date.c,v
retrieving revision 1.31
diff -u -r1.31 date.c
--- date.c      28 Dec 2007 19:17:28 -0000      1.31
+++ date.c      25 Jul 2008 20:30:46 -0000
@@ -70,7 +70,7 @@
 
 static void setthetime(char *);
 static void badformat(void);
-static void usage(void);
+static __dead void usage(void);
 
 int
 main(int argc, char *argv[])
@@ -261,7 +261,7 @@
        usage();
 }
 
-static void
+static __dead void
 usage(void)
 {
        (void)fprintf(stderr,


<Prev in Thread] Current Thread [Next in Thread>