Refctor, simplify return statements, no parenthesis needed
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
f1f1ee3563
commit
2e84a34758
14
src/klogd.c
14
src/klogd.c
@ -501,7 +501,7 @@ static enum LOGSRC GetKernelLogSrc(void)
|
|||||||
Syslog(LOG_INFO, "klogd v%s, log source = ksyslog "
|
Syslog(LOG_INFO, "klogd v%s, log source = ksyslog "
|
||||||
"started.",
|
"started.",
|
||||||
PACKAGE_VERSION);
|
PACKAGE_VERSION);
|
||||||
return (kernel);
|
return kernel;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TESTING
|
#ifndef TESTING
|
||||||
@ -518,7 +518,7 @@ static enum LOGSRC GetKernelLogSrc(void)
|
|||||||
|
|
||||||
Syslog(LOG_INFO, "klogd v%s, log source = %s started.",
|
Syslog(LOG_INFO, "klogd v%s, log source = %s started.",
|
||||||
VERSION, _PATH_KLOG);
|
VERSION, _PATH_KLOG);
|
||||||
return (proc);
|
return proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void Syslog(int priority, char *fmt, ...)
|
extern void Syslog(int priority, char *fmt, ...)
|
||||||
@ -613,7 +613,7 @@ static int copyin(char *line, int space,
|
|||||||
for (i = 0; i < count && !strchr(delim, *ptr); i++)
|
for (i = 0; i < count && !strchr(delim, *ptr); i++)
|
||||||
*line++ = *ptr++;
|
*line++ = *ptr++;
|
||||||
|
|
||||||
return (i);
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -933,11 +933,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
case 'i': /* Reload module symbols. */
|
case 'i': /* Reload module symbols. */
|
||||||
SignalDaemon(SIGUSR1);
|
SignalDaemon(SIGUSR1);
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
case 'I':
|
case 'I':
|
||||||
SignalDaemon(SIGUSR2);
|
SignalDaemon(SIGUSR2);
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
case 'k': /* Kernel symbol file. */
|
case 'k': /* Kernel symbol file. */
|
||||||
symfile = optarg;
|
symfile = optarg;
|
||||||
@ -984,7 +984,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stderr, "klogd: Invalid console logging "
|
fprintf(stderr, "klogd: Invalid console logging "
|
||||||
"level <%s> specified.\n",
|
"level <%s> specified.\n",
|
||||||
log_level);
|
log_level);
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
console_log_level = *log_level - '0';
|
console_log_level = *log_level - '0';
|
||||||
}
|
}
|
||||||
@ -1065,7 +1065,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stderr, "klogd: Cannot open output file "
|
fprintf(stderr, "klogd: Cannot open output file "
|
||||||
"%s - %s\n",
|
"%s - %s\n",
|
||||||
output, strerror(errno));
|
output, strerror(errno));
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
openlog("kernel", 0, LOG_KERN);
|
openlog("kernel", 0, LOG_KERN);
|
||||||
|
54
src/ksym.c
54
src/ksym.c
@ -201,7 +201,7 @@ int InitKsyms(char *mapfile)
|
|||||||
Syslog(LOG_WARNING, "Cannot find a map file.");
|
Syslog(LOG_WARNING, "Cannot find a map file.");
|
||||||
if (debugging)
|
if (debugging)
|
||||||
fputs("Cannot find a map file.\n", stderr);
|
fputs("Cannot find a map file.\n", stderr);
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ int InitKsyms(char *mapfile)
|
|||||||
Syslog(LOG_WARNING, "Cannot open map file: %s.", mapfile);
|
Syslog(LOG_WARNING, "Cannot open map file: %s.", mapfile);
|
||||||
if (debugging)
|
if (debugging)
|
||||||
fprintf(stderr, "Cannot open map file: %s.\n", mapfile);
|
fprintf(stderr, "Cannot open map file: %s.\n", mapfile);
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -224,7 +224,7 @@ int InitKsyms(char *mapfile)
|
|||||||
if (fscanf(sym_file, "%lx %c %511s\n", &address, &type, sym) != 3) {
|
if (fscanf(sym_file, "%lx %c %511s\n", &address, &type, sym) != 3) {
|
||||||
Syslog(LOG_ERR, "Error in symbol table input (#1).");
|
Syslog(LOG_ERR, "Error in symbol table input (#1).");
|
||||||
fclose(sym_file);
|
fclose(sym_file);
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
if (VERBOSE_DEBUGGING && debugging)
|
if (VERBOSE_DEBUGGING && debugging)
|
||||||
fprintf(stderr, "Address: %lx, Type: %c, Symbol: %s\n",
|
fprintf(stderr, "Address: %lx, Type: %c, Symbol: %s\n",
|
||||||
@ -233,7 +233,7 @@ int InitKsyms(char *mapfile)
|
|||||||
if (AddSymbol(address, sym) == 0) {
|
if (AddSymbol(address, sym) == 0) {
|
||||||
Syslog(LOG_ERR, "Error adding symbol - %s.", sym);
|
Syslog(LOG_ERR, "Error adding symbol - %s.", sym);
|
||||||
fclose(sym_file);
|
fclose(sym_file);
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version == 0)
|
if (version == 0)
|
||||||
@ -258,7 +258,7 @@ int InitKsyms(char *mapfile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fclose(sym_file);
|
fclose(sym_file);
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -303,7 +303,7 @@ static char *FindSymbolFile(void)
|
|||||||
|
|
||||||
if (uname(&utsname) < 0) {
|
if (uname(&utsname) < 0) {
|
||||||
Syslog(LOG_ERR, "Cannot get kernel version information.");
|
Syslog(LOG_ERR, "Cannot get kernel version information.");
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debugging)
|
if (debugging)
|
||||||
@ -337,7 +337,7 @@ static char *FindSymbolFile(void)
|
|||||||
*/
|
*/
|
||||||
if (debugging)
|
if (debugging)
|
||||||
fprintf(stderr, "End of search list encountered.\n");
|
fprintf(stderr, "End of search list encountered.\n");
|
||||||
return (file);
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -394,7 +394,7 @@ static int CheckVersion(char *version)
|
|||||||
strncmp(++version, prefix, strlen(prefix)) == 0) /* a.out */)
|
strncmp(++version, prefix, strlen(prefix)) == 0) /* a.out */)
|
||||||
;
|
;
|
||||||
else
|
else
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since the symbol looks like a kernel version we can start
|
* Since the symbol looks like a kernel version we can start
|
||||||
@ -424,7 +424,7 @@ static int CheckVersion(char *version)
|
|||||||
*/
|
*/
|
||||||
if (uname(&utsname) < 0) {
|
if (uname(&utsname) < 0) {
|
||||||
Syslog(LOG_ERR, "Cannot get kernel version information.");
|
Syslog(LOG_ERR, "Cannot get kernel version information.");
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
if (debugging)
|
if (debugging)
|
||||||
fprintf(stderr, "Comparing kernel %s with symbol table %s.\n",
|
fprintf(stderr, "Comparing kernel %s with symbol table %s.\n",
|
||||||
@ -433,7 +433,7 @@ static int CheckVersion(char *version)
|
|||||||
if (sscanf(utsname.release, "%d.%d.%d", &major, &minor, &patch) < 3) {
|
if (sscanf(utsname.release, "%d.%d.%d", &major, &minor, &patch) < 3) {
|
||||||
Syslog(LOG_ERR, "Kernel send bogus release string `%s'.",
|
Syslog(LOG_ERR, "Kernel send bogus release string `%s'.",
|
||||||
utsname.release);
|
utsname.release);
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute the version code from data sent by the kernel */
|
/* Compute the version code from data sent by the kernel */
|
||||||
@ -441,11 +441,11 @@ static int CheckVersion(char *version)
|
|||||||
|
|
||||||
/* Failure. */
|
/* Failure. */
|
||||||
if (vnum != kvnum)
|
if (vnum != kvnum)
|
||||||
return (-1);
|
return -1;
|
||||||
|
|
||||||
/* Success. */
|
/* Success. */
|
||||||
#endif
|
#endif
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -494,7 +494,7 @@ static int CheckMapVersion(char *fname)
|
|||||||
&type, sym) != 3) {
|
&type, sym) != 3) {
|
||||||
Syslog(LOG_ERR, "Error in symbol table input (#2).");
|
Syslog(LOG_ERR, "Error in symbol table input (#2).");
|
||||||
fclose(sym_file);
|
fclose(sym_file);
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
if (VERBOSE_DEBUGGING && debugging)
|
if (VERBOSE_DEBUGGING && debugging)
|
||||||
fprintf(stderr, "Address: %lx, Type: %c, "
|
fprintf(stderr, "Address: %lx, Type: %c, "
|
||||||
@ -523,10 +523,10 @@ static int CheckMapVersion(char *fname)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (version);
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -547,17 +547,17 @@ static int AddSymbol(unsigned long address, char *symbol)
|
|||||||
/* Allocate the the symbol table entry. */
|
/* Allocate the the symbol table entry. */
|
||||||
sym_array = realloc(sym_array, (num_syms + 1) * sizeof(struct sym_table));
|
sym_array = realloc(sym_array, (num_syms + 1) * sizeof(struct sym_table));
|
||||||
if (sym_array == NULL)
|
if (sym_array == NULL)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
/* Then the space for the symbol. */
|
/* Then the space for the symbol. */
|
||||||
sym_array[num_syms].name = malloc(strlen(symbol) * sizeof(char) + 1);
|
sym_array[num_syms].name = malloc(strlen(symbol) * sizeof(char) + 1);
|
||||||
if (sym_array[num_syms].name == NULL)
|
if (sym_array[num_syms].name == NULL)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
sym_array[num_syms].value = address;
|
sym_array[num_syms].value = address;
|
||||||
strcpy(sym_array[num_syms].name, symbol);
|
strcpy(sym_array[num_syms].name, symbol);
|
||||||
++num_syms;
|
++num_syms;
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -587,13 +587,13 @@ char *LookupSymbol(unsigned long value, struct symbol *sym)
|
|||||||
int lp;
|
int lp;
|
||||||
|
|
||||||
if (!sym_array)
|
if (!sym_array)
|
||||||
return ((char *)0);
|
return NULL;
|
||||||
|
|
||||||
last = sym_array[0].name;
|
last = sym_array[0].name;
|
||||||
ksym.offset = 0;
|
ksym.offset = 0;
|
||||||
ksym.size = 0;
|
ksym.size = 0;
|
||||||
if (value < sym_array[0].value)
|
if (value < sym_array[0].value)
|
||||||
return ((char *)0);
|
return NULL;
|
||||||
|
|
||||||
for (lp = 0; lp <= num_syms; ++lp) {
|
for (lp = 0; lp <= num_syms; ++lp) {
|
||||||
if (sym_array[lp].value > value) {
|
if (sym_array[lp].value > value) {
|
||||||
@ -615,11 +615,11 @@ char *LookupSymbol(unsigned long value, struct symbol *sym)
|
|||||||
(ksym.offset > 0 && ksym.offset < msym.offset)) {
|
(ksym.offset > 0 && ksym.offset < msym.offset)) {
|
||||||
sym->offset = ksym.offset;
|
sym->offset = ksym.offset;
|
||||||
sym->size = ksym.size;
|
sym->size = ksym.size;
|
||||||
return (last);
|
return last;
|
||||||
} else {
|
} else {
|
||||||
sym->offset = msym.offset;
|
sym->offset = msym.offset;
|
||||||
sym->size = msym.size;
|
sym->size = msym.size;
|
||||||
return (name);
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -712,7 +712,7 @@ char *ExpandKadds(char *line, char *el)
|
|||||||
if ((num_syms == 0) ||
|
if ((num_syms == 0) ||
|
||||||
(kp = strstr(line, "[<")) == (char *)0) {
|
(kp = strstr(line, "[<")) == (char *)0) {
|
||||||
strcpy(el, line);
|
strcpy(el, line);
|
||||||
return (el);
|
return el;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop through and expand all kernel messages. */
|
/* Loop through and expand all kernel messages. */
|
||||||
@ -723,7 +723,7 @@ char *ExpandKadds(char *line, char *el)
|
|||||||
/* Now poised at a kernel delimiter. */
|
/* Now poised at a kernel delimiter. */
|
||||||
if ((kp = strstr(sl, ">]")) == (char *)0) {
|
if ((kp = strstr(sl, ">]")) == (char *)0) {
|
||||||
strcpy(el, sl);
|
strcpy(el, sl);
|
||||||
return (el);
|
return el;
|
||||||
}
|
}
|
||||||
dlm = *kp;
|
dlm = *kp;
|
||||||
strncpy(num, sl + 1, kp - sl - 1);
|
strncpy(num, sl + 1, kp - sl - 1);
|
||||||
@ -755,7 +755,7 @@ char *ExpandKadds(char *line, char *el)
|
|||||||
|
|
||||||
if (debugging)
|
if (debugging)
|
||||||
fprintf(stderr, "Expanded line: %s\n", el);
|
fprintf(stderr, "Expanded line: %s\n", el);
|
||||||
return (el);
|
return el;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -795,7 +795,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!InitKsyms((char *)0)) {
|
if (!InitKsyms((char *)0)) {
|
||||||
fputs("ksym: Error loading system map.\n", stderr);
|
fputs("ksym: Error loading system map.\n", stderr);
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!feof(stdin)) {
|
while (!feof(stdin)) {
|
||||||
@ -807,7 +807,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stdout, "%s\n", eline);
|
fprintf(stdout, "%s\n", eline);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Syslog(int priority, char *fmt, ...)
|
void Syslog(int priority, char *fmt, ...)
|
||||||
|
@ -185,7 +185,7 @@ extern int InitMsyms(void)
|
|||||||
Syslog(LOG_ERR, "Error loading kernel symbols "
|
Syslog(LOG_ERR, "Error loading kernel symbols "
|
||||||
"- %s\n",
|
"- %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debugging)
|
if (debugging)
|
||||||
@ -230,7 +230,7 @@ extern int InitMsyms(void)
|
|||||||
(rtn == 1) ? "symbol" : "symbols",
|
(rtn == 1) ? "symbol" : "symbols",
|
||||||
num_modules, (num_modules == 1) ? "." : "s.");
|
num_modules, (num_modules == 1) ? "." : "s.");
|
||||||
|
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int symsort(const void *p1, const void *p2)
|
static int symsort(const void *p1, const void *p2)
|
||||||
@ -239,12 +239,12 @@ static int symsort(const void *p1, const void *p2)
|
|||||||
*sym2 = p2;
|
*sym2 = p2;
|
||||||
|
|
||||||
if (sym1->value < sym2->value)
|
if (sym1->value < sym2->value)
|
||||||
return (-1);
|
return -1;
|
||||||
|
|
||||||
if (sym1->value == sym2->value)
|
if (sym1->value == sym2->value)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -381,7 +381,7 @@ static int AddSymbol(const char *line)
|
|||||||
|
|
||||||
p = index(line, ' ');
|
p = index(line, ' ');
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return (0);
|
return 0;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
address = strtoul(line, (char **)0, 16);
|
address = strtoul(line, (char **)0, 16);
|
||||||
@ -395,7 +395,7 @@ static int AddSymbol(const char *line)
|
|||||||
mp = AddModule(module);
|
mp = AddModule(module);
|
||||||
|
|
||||||
if (mp == NULL)
|
if (mp == NULL)
|
||||||
return (0);
|
return 0;
|
||||||
} else
|
} else
|
||||||
mp = &sym_array_modules[num_modules - 1];
|
mp = &sym_array_modules[num_modules - 1];
|
||||||
|
|
||||||
@ -406,17 +406,17 @@ static int AddSymbol(const char *line)
|
|||||||
(mp->num_syms + 1) * sizeof(struct sym_table));
|
(mp->num_syms + 1) * sizeof(struct sym_table));
|
||||||
|
|
||||||
if (mp->sym_array == (struct sym_table *)0)
|
if (mp->sym_array == (struct sym_table *)0)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
mp->sym_array[mp->num_syms].name = strdup(p);
|
mp->sym_array[mp->num_syms].name = strdup(p);
|
||||||
if (mp->sym_array[mp->num_syms].name == (char *)0)
|
if (mp->sym_array[mp->num_syms].name == (char *)0)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
/* Stuff interesting information into the module. */
|
/* Stuff interesting information into the module. */
|
||||||
mp->sym_array[mp->num_syms].value = address;
|
mp->sym_array[mp->num_syms].value = address;
|
||||||
++mp->num_syms;
|
++mp->num_syms;
|
||||||
|
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -484,7 +484,7 @@ char *LookupModuleSymbol(unsigned long value, struct symbol *sym)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sym->size > 0)
|
if (sym->size > 0)
|
||||||
return (ret);
|
return ret;
|
||||||
|
|
||||||
/* It has been a hopeless exercise. */
|
/* It has been a hopeless exercise. */
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -505,7 +505,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!InitMsyms()) {
|
if (!InitMsyms()) {
|
||||||
fprintf(stderr, "Cannot load module symbols.\n");
|
fprintf(stderr, "Cannot load module symbols.\n");
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Number of modules: %d\n\n", num_modules);
|
printf("Number of modules: %d\n\n", num_modules);
|
||||||
@ -527,7 +527,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
FreeModules();
|
FreeModules();
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Syslog(int priority, char *fmt, ...)
|
void Syslog(int priority, char *fmt, ...)
|
||||||
|
@ -75,7 +75,7 @@ int check_pid(char *pidfile)
|
|||||||
*/
|
*/
|
||||||
/* But... errno is usually changed only on error.. */
|
/* But... errno is usually changed only on error.. */
|
||||||
if (kill(pid, 0) && errno == ESRCH)
|
if (kill(pid, 0) && errno == ESRCH)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ int setlogmask(int pmask)
|
|||||||
omask = LogMask;
|
omask = LogMask;
|
||||||
if (pmask != 0)
|
if (pmask != 0)
|
||||||
LogMask = pmask;
|
LogMask = pmask;
|
||||||
return (omask);
|
return omask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,10 +58,10 @@ int main(int argc, char *argv[])
|
|||||||
syslog(LOG_INFO, "Info log.");
|
syslog(LOG_INFO, "Info log.");
|
||||||
syslog(LOG_DEBUG, "Debug log.");
|
syslog(LOG_DEBUG, "Debug log.");
|
||||||
closelog();
|
closelog();
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2305,14 +2305,14 @@ const char *cvthname(struct sockaddr_storage *f, int len)
|
|||||||
if ((p = strchr(hname, '.'))) {
|
if ((p = strchr(hname, '.'))) {
|
||||||
if (strcmp(p + 1, LocalDomain) == 0) {
|
if (strcmp(p + 1, LocalDomain) == 0) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
return (hname);
|
return hname;
|
||||||
} else {
|
} else {
|
||||||
if (StripDomains) {
|
if (StripDomains) {
|
||||||
count = 0;
|
count = 0;
|
||||||
while (StripDomains[count]) {
|
while (StripDomains[count]) {
|
||||||
if (strcmp(p + 1, StripDomains[count]) == 0) {
|
if (strcmp(p + 1, StripDomains[count]) == 0) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
return (hname);
|
return hname;
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -2322,7 +2322,7 @@ const char *cvthname(struct sockaddr_storage *f, int len)
|
|||||||
while (LocalHosts[count]) {
|
while (LocalHosts[count]) {
|
||||||
if (!strcmp(hname, LocalHosts[count])) {
|
if (!strcmp(hname, LocalHosts[count])) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
return (hname);
|
return hname;
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -2330,7 +2330,7 @@ const char *cvthname(struct sockaddr_storage *f, int len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (hname);
|
return hname;
|
||||||
}
|
}
|
||||||
|
|
||||||
void domark(int signo)
|
void domark(int signo)
|
||||||
@ -2971,7 +2971,7 @@ int decode(char *name, struct code *codetab)
|
|||||||
logit("symbolic name: %s", name);
|
logit("symbolic name: %s", name);
|
||||||
if (isdigit(*name)) {
|
if (isdigit(*name)) {
|
||||||
logit("\n");
|
logit("\n");
|
||||||
return (atoi(name));
|
return atoi(name);
|
||||||
}
|
}
|
||||||
(void)strncpy(buf, name, 79);
|
(void)strncpy(buf, name, 79);
|
||||||
for (p = buf; *p; p++)
|
for (p = buf; *p; p++)
|
||||||
@ -2980,9 +2980,9 @@ int decode(char *name, struct code *codetab)
|
|||||||
for (c = codetab; c->c_name; c++)
|
for (c = codetab; c->c_name; c++)
|
||||||
if (!strcmp(buf, c->c_name)) {
|
if (!strcmp(buf, c->c_name)) {
|
||||||
logit(" ==> %d\n", c->c_val);
|
logit(" ==> %d\n", c->c_val);
|
||||||
return (c->c_val);
|
return c->c_val;
|
||||||
}
|
}
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void logit(char *fmt, ...)
|
static void logit(char *fmt, ...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user