summaryrefslogtreecommitdiff
path: root/util-linux/rdate.c
diff options
context:
space:
mode:
authorMatt Kraai2000-12-18 03:57:16 +0000
committerMatt Kraai2000-12-18 03:57:16 +0000
commit1fa1adea2ae16d4f4c82d7466905dce4c6edd5f5 (patch)
treeb85a425c19b299f5d8635599e11c78c96f12a4c2 /util-linux/rdate.c
parent0dab82997777bffb95d01d68e1628ee79207a03d (diff)
downloadbusybox-1fa1adea2ae16d4f4c82d7466905dce4c6edd5f5.zip
busybox-1fa1adea2ae16d4f4c82d7466905dce4c6edd5f5.tar.gz
Change calls to error_msg.* and strerror to use perror_msg.*.
Diffstat (limited to 'util-linux/rdate.c')
-rw-r--r--util-linux/rdate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 87edecb..03f7f2d 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -47,15 +47,15 @@ time_t askremotedate(char *host)
int fd;
if (!(h = gethostbyname(host))) { /* get the IP addr */
- error_msg("%s: %s\n", host, strerror(errno));
+ perror_msg("%s", host);
return(-1);
}
if ((tserv = getservbyname("time", "tcp")) == NULL) { /* find port # */
- error_msg("%s: %s\n", "time", strerror(errno));
+ perror_msg("%s", "time");
return(-1);
}
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { /* get net connection */
- error_msg("%s: %s\n", "socket", strerror(errno));
+ perror_msg("%s", "socket");
return(-1);
}
@@ -64,7 +64,7 @@ time_t askremotedate(char *host)
sin.sin_family = AF_INET;
if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { /* connect to time server */
- error_msg("%s: %s\n", host, strerror(errno));
+ perror_msg("%s", host);
close(fd);
return(-1);
}
@@ -123,7 +123,7 @@ int rdate_main(int argc, char **argv)
}
if (setdate) {
if (stime(&time) < 0)
- error_msg_and_die("Could not set time of day: %s\n", strerror(errno));
+ perror_msg_and_die("Could not set time of day");
}
if (printdate) {
fprintf(stdout, "%s", ctime(&time));