Skip to content
Browse files

uclibc: replace BSD __progname with macro

  • Loading branch information...
1 parent da495f7 commit bf38431de63660825438be68889f16e97b7d3f5d @msantos committed Jul 15, 2011
Showing with 6 additions and 9 deletions.
  1. +1 −2 sods/sods.c
  2. +4 −5 sods/sods_err.c
  3. +1 −2 sods/sods_priv.c
View
3 sods/sods.c
@@ -28,7 +28,6 @@
#include "sods.h"
-extern char *__progname;
int sds_parse_forward(SDS_STATE *ss, char *buf);
void sds_print_forward(SDS_STATE *ss);
@@ -206,7 +205,7 @@ sds_timestamp(void)
void
usage(SDS_STATE *ss)
{
- (void)fprintf(stderr, "%s, %s\n", __progname, SDS_VERSION);
+ (void)fprintf(stderr, "%s, %s\n", SDS_PROGNAME, SDS_VERSION);
(void)fprintf(stderr,
"usage: sods <option> <domain name>\n"
" -c max connections\n"
View
9 sods/sods_err.c
@@ -23,14 +23,13 @@
#include "sods.h"
-//extern char *__progname;
void
sds_err(int rv, char *fmt, ...)
{
va_list ap;
- (void)fprintf(stderr, "sods: ");
+ (void)fprintf(stderr, "%s: ", SDS_PROGNAME);
va_start(ap, fmt);
(void)vfprintf(stderr, fmt, ap);
va_end(ap);
@@ -44,7 +43,7 @@ sds_errx(int rv, char *fmt, ...)
{
va_list ap;
- (void)fprintf(stderr, "sods: ");
+ (void)fprintf(stderr, "%s: ", SDS_PROGNAME);
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
@@ -58,7 +57,7 @@ sds_warn(char *fmt, ...)
{
va_list ap;
- (void)fprintf(stderr, "sods: ");
+ (void)fprintf(stderr, "%s: ", SDS_PROGNAME);
va_start(ap, fmt);
(void)vfprintf(stderr, fmt, ap);
va_end(ap);
@@ -70,7 +69,7 @@ sds_warnx(char *fmt, ...)
{
va_list ap;
- (void)fprintf(stderr, "sods: ");
+ (void)fprintf(stderr, "%s: ", SDS_PROGNAME);
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
View
3 sods/sods_priv.c
@@ -33,7 +33,6 @@
void sds_priv_daemon(SDS_STATE *ss);
int sds_priv_drop(SDS_STATE *ss);
-extern char *__progname;
int
sds_priv_init(SDS_STATE *ss)
@@ -46,7 +45,7 @@ sds_priv_init(SDS_STATE *ss)
void
sds_priv_daemon(SDS_STATE *ss)
{
- openlog(__progname, LOG_NDELAY, LOG_DAEMON);
+ openlog(SDS_PROGNAME, LOG_NDELAY, LOG_DAEMON);
IS_ERR(daemon(0, 0));
}

0 comments on commit bf38431

Please sign in to comment.
Something went wrong with that request. Please try again.