diff options
-rw-r--r-- | 6pack/m6pack.8 | 2 | ||||
-rw-r--r-- | 6pack/m6pack.c | 2 | ||||
-rw-r--r-- | ax25/access.c | 34 | ||||
-rw-r--r-- | ax25/ax25d.c | 14 | ||||
-rw-r--r-- | ax25/axgetput/axgetput.c | 12 | ||||
-rw-r--r-- | ax25/axgetput/proto_bin.c | 72 | ||||
-rw-r--r-- | ax25/axgetput/util.c | 66 | ||||
-rw-r--r-- | ax25/axparms.c | 2 | ||||
-rw-r--r-- | ax25/axspawn.c | 308 | ||||
-rw-r--r-- | ax25/rxecho.c | 10 | ||||
-rw-r--r-- | hdlcutil/fl/xfhdlcchpar_main.cxx | 2 | ||||
-rw-r--r-- | hdlcutil/fl/xfhdlcst_main.cxx | 2 | ||||
-rw-r--r-- | hdlcutil/fl/xfsmdiag.cxx | 40 | ||||
-rw-r--r-- | hdlcutil/fl/xfsmdiag_main.cxx | 24 | ||||
-rw-r--r-- | hdlcutil/fl/xfsmmixer.cxx | 202 | ||||
-rw-r--r-- | hdlcutil/fl/xfsmmixer_main.cxx | 4 | ||||
-rw-r--r-- | hdlcutil/hdlcdrv.9 | 26 | ||||
-rw-r--r-- | hdlcutil/hdrvcomm.c | 2 | ||||
-rw-r--r-- | hdlcutil/hdrvcomm.h | 26 | ||||
-rw-r--r-- | hdlcutil/sethdlc.c | 2 | ||||
-rw-r--r-- | hdlcutil/smdiag.c | 172 | ||||
-rw-r--r-- | hdlcutil/smmixer.c | 20 | ||||
-rw-r--r-- | kiss/kissattach.c | 8 | ||||
-rw-r--r-- | kiss/kissnetd.c | 4 | ||||
-rw-r--r-- | kiss/mkiss.c | 16 | ||||
-rw-r--r-- | kiss/net2kiss.c | 12 | ||||
-rw-r--r-- | netrom/netromr.c | 2 | ||||
-rw-r--r-- | netrom/nrsdrv.c | 20 | ||||
-rw-r--r-- | rose/rsmemsiz.c | 8 | ||||
-rw-r--r-- | tcpip/ttylinkd.c | 4 | ||||
-rw-r--r-- | yamdrv/README.yamdrv | 2 |
31 files changed, 560 insertions, 560 deletions
diff --git a/6pack/m6pack.8 b/6pack/m6pack.8 index 7ed202c..7963054 100644 --- a/6pack/m6pack.8 +++ b/6pack/m6pack.8 @@ -48,7 +48,7 @@ This option is for Unix98 PTYs. It allocates "number" ptys; their names are writ .BR ifconfig (8), .BR kill (1). .SH AUTHORS -Iņaki Arenaza EB2EBU <iarenaza@escomposlinux.org>, based in the work by: +I.aki Arenaza EB2EBU <iarenaza@escomposlinux.org>, based in the work by: .br Tomi Manninen OH2BNS <oh2bns@sral.fi> .br diff --git a/6pack/m6pack.c b/6pack/m6pack.c index 43d20cf..541658d 100644 --- a/6pack/m6pack.c +++ b/6pack/m6pack.c @@ -459,7 +459,7 @@ int main(int argc, char *argv[]) return 1; } - numptys = argc - optind - 1; + numptys = argc - optind - 1; if (numptys + ptmxdevices > MAX_PTYS) { fprintf(stderr, "m6pack: max %d pty interfaces allowed.\n", diff --git a/ax25/access.c b/ax25/access.c index 6fac554..1363238 100644 --- a/ax25/access.c +++ b/ax25/access.c @@ -82,23 +82,23 @@ char *generate_rand_pw(int len) if (len > PASSSIZE) len = PASSSIZE; - for (i = 0; i < len; i++) { - j = conv_random(10+26*2, 0); - if (j < 10) { - pass[i] = j + '0'; - continue; - } - j -= 10; - if (j < 26) { - pass[i] = j + 'A'; + for (i = 0; i < len; i++) { + j = conv_random(10+26*2, 0); + if (j < 10) { + pass[i] = j + '0'; continue; - } - j -= 26; - pass[i] = j + 'a'; - } - pass[len] = 0; + } + j -= 10; + if (j < 26) { + pass[i] = j + 'A'; + continue; + } + j -= 26; + pass[i] = j + 'a'; + } + pass[len] = 0; - return pass; + return pass; } /*--------------------------------------------------------------------------*/ @@ -357,7 +357,7 @@ char *read_pwd (struct passwd *pw, int *pwtype) for (p = pass; *p && !isspace(*p & 0xff); p++) ; *p = 0; - if ( (*pwtype & PW_MD5) && !Strcasecmp(p_buf, "md5") ) { + if ( (*pwtype & PW_MD5) && !Strcasecmp(p_buf, "md5") ) { fclose(f); *pwtype = PW_MD5; goto found; @@ -391,6 +391,6 @@ found: end: *pwtype = (((*pwtype) & PW_CLEARTEXT) ? PW_CLEARTEXT : 0); - /* ^ may allow cleartext? - then cleartext, else deny */ + /* ^ may allow cleartext? - then cleartext, else deny */ return 0; } diff --git a/ax25/ax25d.c b/ax25/ax25d.c index ee921ab..472b461 100644 --- a/ax25/ax25d.c +++ b/ax25/ax25d.c @@ -535,7 +535,7 @@ int main(int argc, char *argv[]) /* debug */ syslog((LOG_DEBUG), "DEBUG: AX.25 %s (%s:%s) AX25.IP-VC host said: >%s<", User, Port, myAX25Name, buf); } - /* skip leading mess */ + /* skip leading mess */ for (p = buf; *p && (isspace(*p & 0xff) || *p == '\r'); p++) ; if (raxl->VCdiscOnLinkfailureMsg && !strncmp(p, "***", 3)) { /* format received line for debug purposes */ @@ -554,9 +554,9 @@ int main(int argc, char *argv[]) break; } /* per default, we discard all messages, - * because there's no useful combination - * using VC and pidText togegther - */ + * because there's no useful combination + * using VC and pidText togegther + */ if (raxl->VCloginEnable) goto login; } @@ -979,13 +979,13 @@ static int ReadConfig(void) reload_timer(60); continue; } - /* xlz - have to nuke this as this option is gone - * what should be here? + /* xlz - have to nuke this as this option is gone + * what should be here? if (iamdigi) { yes = 1; setsockopt(axl_port->fd, SOL_AX25, AX25_IAMDIGI, &yes, sizeof(yes)); } - */ + */ if (bind(axl_port->fd, (struct sockaddr *)&sockaddr, addrlen) < 0) { fprintf(stderr, "ax25d: bind: %s on port %s\n", strerror(errno), axl_port->port); diff --git a/ax25/axgetput/axgetput.c b/ax25/axgetput/axgetput.c index c2f4d25..595215c 100644 --- a/ax25/axgetput/axgetput.c +++ b/ax25/axgetput/axgetput.c @@ -264,17 +264,17 @@ int main(int argc, char *argv[]) #define get_filename(f) { \ if (!strcmp(f, "-")) { \ if (mode % 2) \ - fdin_is_pipe = 1; \ - else \ - fdout_is_pipe = 1; \ + fdin_is_pipe = 1; \ + else \ + fdout_is_pipe = 1; \ } else { \ - strncpy(filename, f, sizeof(filename)-1); \ - filename[sizeof(filename)-1] = 0; \ + strncpy(filename, f, sizeof(filename)-1); \ + filename[sizeof(filename)-1] = 0; \ if (mode % 2) { \ if (fdin_is_pipe) \ fdin_is_pipe = 0; \ } else { \ - if (fdout_is_pipe) \ + if (fdout_is_pipe) \ fdout_is_pipe = 0; \ } \ } \ diff --git a/ax25/axgetput/proto_bin.c b/ax25/axgetput/proto_bin.c index d02249b..9be7a58 100644 --- a/ax25/axgetput/proto_bin.c +++ b/ax25/axgetput/proto_bin.c @@ -26,7 +26,7 @@ static int init_crc(void) crctab[i] = 0; for (j = 0; j < 8; j++) { if ((bittab[j] & i) != 0) { - crctab[i] = crctab[i] ^ crcbit[j]; + crctab[i] = crctab[i] ^ crcbit[j]; } } } @@ -113,7 +113,7 @@ int bput(void) return 1; } if (buf[len-1] == '\r' && len > 5 && !memcmp(buf, "#BIN#", 5)) { - break; + break; } if (len == sizeof(buf)) { sprintf(err_msg, "line to long\n"); @@ -139,12 +139,12 @@ int bput(void) break; default: if (*p == '|') { - msg_crc = (unsigned int ) atoi(p+1); + msg_crc = (unsigned int ) atoi(p+1); } else if (*p == '$') { - file_time = parse_sfbin_date_to_unix(p+1); + file_time = parse_sfbin_date_to_unix(p+1); } else { - strncpy(filename_given, p, sizeof(filename_given)-1); - filename_given[sizeof(filename_given)-1] = 0; + strncpy(filename_given, p, sizeof(filename_given)-1); + filename_given[sizeof(filename_given)-1] = 0; } } } @@ -159,8 +159,8 @@ int bput(void) if (!stat(filename, &statbuf)) { /* file exist */ if (unlink(filename)) { - sprintf(err_msg, "error: cannot unlink %s (%s)\n", filename, strerror(errno)); - goto abort; + sprintf(err_msg, "error: cannot unlink %s (%s)\n", filename, strerror(errno)); + goto abort; } } if ((fddata = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0640)) < 0) { @@ -194,7 +194,7 @@ int bput(void) if (!len) { save_close(fddata); if (!term_line) { - sprintf(err_msg, "error: unexpected end of file during read: %s\n", strerror(errno)); + sprintf(err_msg, "error: unexpected end of file during read: %s\n", strerror(errno)); return 1; } return 0; @@ -203,14 +203,14 @@ int bput(void) if (msg_crc) { int i; for (i = 0; i < len; i++) - crc = do_crc((int ) buf[i], 1, crc); + crc = do_crc((int ) buf[i], 1, crc); } if (buf[len-1] == '\r') { if (last_line_had_CR) { if (IS_BIN_ABORT(buf, len)) { /* "\r#ABORT#\r" was sent */ - if (!fdout_is_pipe) { + if (!fdout_is_pipe) { close(fddata); /* clean up */ unlink(filename); @@ -218,8 +218,8 @@ int bput(void) return 1; } if (term_line && len == len_termline && !memcmp(buf, term_line, len_termline)) { - /* sucessfully read until termination string */ - break; + /* sucessfully read until termination string */ + break; } } last_line_had_CR = 1; @@ -241,7 +241,7 @@ int bput(void) if (is_eof) { if (!term_line && len_read_left) { save_close(fddata); - goto abort; + goto abort; } break; } @@ -304,13 +304,13 @@ int bget(void) { } #define store_line(s, len) { \ - if (!(sl = (struct strlist *) malloc(sizeof(struct strlist *) + sizeof(size_t) + len))) \ + if (!(sl = (struct strlist *) malloc(sizeof(struct strlist *) + sizeof(size_t) + len))) \ return 1; \ sl->next = 0; \ sl->len = len; \ memcpy(sl->data, s, len); \ if (!stored_file) { \ - stored_file = sl; \ + stored_file = sl; \ } else { \ sl_tail->next = sl; \ } \ @@ -336,7 +336,7 @@ int bget(void) { while ((len = read(fddata, buf, BLOCKSIZ)) > 0) { int i; for (i = 0; i < len; i++) - crc = do_crc((int ) buf[i], 1, crc); + crc = do_crc((int ) buf[i], 1, crc); file_size += len; } if (len < 0) { @@ -356,17 +356,17 @@ int bget(void) { if (!is_stream || do_crc_only) { sprintf(err_msg, "error: not enough memory\n"); while ((len = read(fddata, buf, sizeof(buf))) > 0) { - int i; - for (i = 0; i < len; i++) - crc = do_crc((int ) buf[i], 1, crc); - file_size += len; + int i; + for (i = 0; i < len; i++) + crc = do_crc((int ) buf[i], 1, crc); + file_size += len; if (!do_crc_only) store_line(buf, len); } if (len < 0) { - sprintf(err_msg, "error: read failed (%s)\n", strerror(errno)); - close(fddata); - return 1; + sprintf(err_msg, "error: read failed (%s)\n", strerror(errno)); + close(fddata); + return 1; } *err_msg = 0; sprintf(buf, "\r#BIN#%ld#|%d#$%s#%s\r", file_size, crc, unix_to_sfbin_date_string(file_time), get_fixed_filename(filename, file_size, crc, 1)); @@ -396,7 +396,7 @@ int bget(void) { /* wait for answer */ for (;;) { - /* + /* * make sure we do not read from a pipe. fdout is also * assigned to the tty */ @@ -442,26 +442,26 @@ int bget(void) { FD_SET(fdin, &readfds); if (select(fdin+1, &readfds, 0, 0, &timeout) && FD_ISSET(fdin, &readfds)) { if ((len = read(fdin, buf, sizeof(buf))) < 0) { - sprintf(err_msg, "read from tty failed (%s)\n", strerror(errno)); - save_close(fddata); - goto abort; + sprintf(err_msg, "read from tty failed (%s)\n", strerror(errno)); + save_close(fddata); + goto abort; } if (IS_BIN_ABORT(buf, len)) { - sprintf(err_msg, "Aborted by user request\n"); - save_close(fddata); - return 1; + sprintf(err_msg, "Aborted by user request\n"); + save_close(fddata); + return 1; } } /* read data */ if (!fdin_is_pipe || is_stream) { p_buf = buf; if ((len = my_read(fddata, buf, ((len_remains > BLOCKSIZ || is_stream) ? BLOCKSIZ : len_remains), &is_eof, 0)) < 1) { - save_close(fddata); - if (len < 0) { - sprintf(err_msg, "error: read failed (%s)\n", strerror(errno)); + save_close(fddata); + if (len < 0) { + sprintf(err_msg, "error: read failed (%s)\n", strerror(errno)); goto abort; - } - break; + } + break; } len_remains -= len; } else { diff --git a/ax25/axgetput/util.c b/ax25/axgetput/util.c index 98caeeb..f20937f 100644 --- a/ax25/axgetput/util.c +++ b/ax25/axgetput/util.c @@ -54,8 +54,8 @@ int my_read(int fd, char *s, int len_max, int *eof, char *p_break) if ((len = read(fd, s_curr, (p_break ? 1 : len_max))) < 1) { if (len == -1 && errno == EAGAIN) { - sleep(10); - continue; + sleep(10); + continue; } *eof = 1; /* @@ -89,8 +89,8 @@ int secure_write(int fd, char *s, int len_write) { int len; if ((len = write(fd, s, len_write_left_curr)) < 0) { if (len == -1 && errno == EAGAIN) { - sleep(10); - continue; + sleep(10); + continue; } return -1; } @@ -162,22 +162,22 @@ char *get_fixed_filename(char *line, long size, unsigned int msg_crc, int genera /* Linear day numbers of the respective 1sts in non-leap years. */ static int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 }; - /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */ + /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */ /*---------------------------------------------------------------------------*/ long date_dos2unix(unsigned short time,unsigned short date) { - int month,year; - long secs; - - month = ((date >> 5) & 15)-1; - year = date >> 9; - secs = (time & 31)*2+60*((time >> 5) & 63)+(time >> 11)*3600+86400* - ((date & 31)-1+day_n[month]+(year/4)+year*365-((year & 3) == 0 && - month < 2 ? 1 : 0)+3653); - /* days since 1.1.70 plus 80's leap day */ - return secs; + int month,year; + long secs; + + month = ((date >> 5) & 15)-1; + year = date >> 9; + secs = (time & 31)*2+60*((time >> 5) & 63)+(time >> 11)*3600+86400* + ((date & 31)-1+day_n[month]+(year/4)+year*365-((year & 3) == 0 && + month < 2 ? 1 : 0)+3653); + /* days since 1.1.70 plus 80's leap day */ + return secs; } /*---------------------------------------------------------------------------*/ @@ -186,22 +186,22 @@ long date_dos2unix(unsigned short time,unsigned short date) void date_unix2dos(int unix_date,unsigned short *time, unsigned short *date) { - int day,year,nl_day,month; - - *time = (unix_date % 60)/2+(((unix_date/60) % 60) << 5)+ - (((unix_date/3600) % 24) << 11); - day = unix_date/86400-3652; - year = day/365; - if ((year+3)/4+365*year > day) year--; - day -= (year+3)/4+365*year; - if (day == 59 && !(year & 3)) { - nl_day = day; - month = 2; - } - else { - nl_day = (year & 3) || day <= 59 ? day : day-1; - for (month = 0; month < 12; month++) - if (day_n[month] > nl_day) break; - } - *date = nl_day-day_n[month-1]+1+(month << 5)+(year << 9); + int day,year,nl_day,month; + + *time = (unix_date % 60)/2+(((unix_date/60) % 60) << 5)+ + (((unix_date/3600) % 24) << 11); + day = unix_date/86400-3652; + year = day/365; + if ((year+3)/4+365*year > day) year--; + day -= (year+3)/4+365*year; + if (day == 59 && !(year & 3)) { + nl_day = day; + month = 2; + } + else { + nl_day = (year & 3) || day <= 59 ? day : day-1; + for (month = 0; month < 12; month++) + if (day_n[month] > nl_day) break; + } + *date = nl_day-day_n[month-1]+1+(month << 5)+(year << 9); } diff --git a/ax25/axparms.c b/ax25/axparms.c index 8decf93..1f1f6ca 100644 --- a/ax25/axparms.c +++ b/ax25/axparms.c @@ -319,7 +319,7 @@ int forward(int s, int argc, char *argv[]) return 1; } #else - fprintf(stderr, "axparms: Not compiled in with forwarding option.\n"); + fprintf(stderr, "axparms: Not compiled in with forwarding option.\n"); #endif /* HAVE_AX25_FWD_STRUCT */ return 0; diff --git a/ax25/axspawn.c b/ax25/axspawn.c index e92d3ac..9e74e85 100644 --- a/ax25/axspawn.c +++ b/ax25/axspawn.c @@ -776,7 +776,7 @@ void kick_wqueue(int dummy) if (w_buf->len > curr_len) { /* rewrite current buffer, and break */ w_buf->len -= curr_len; - for (q = w_buf->data, r = w_buf->data+curr_len, i = 0; i < w_buf->len; i++) + for (q = w_buf->data, r = w_buf->data+curr_len, i = 0; i < w_buf->len; i++) *q++ = *r++; break; } @@ -910,7 +910,7 @@ int write_ax25(char *s, int len, int kick) } while (j < len) { if ((j + 1 < len) && *(p + j) == '\r' && *(p + j + 1) == '\n') { - *(p + i) = '\r'; + *(p + i) = '\r'; j++; } else @@ -1148,9 +1148,9 @@ end_mkdirs: */ opt_shell = " -s \"/bin/sh\""; } - sprintf(command,"/usr/sbin/useradd -p \"%s\" -c %s -d %s -u %d -g %d -m %s%s", + sprintf(command,"/usr/sbin/useradd -p \"%s\" -c %s -d %s -u %d -g %d -m %s%s", ((policy_add_empty_password) ? "" : "+"), - username, userdir, uid, user_gid, newuser, opt_shell); + username, userdir, uid, user_gid, newuser, opt_shell); if (system(command) != 0) goto out; } else { @@ -1202,7 +1202,7 @@ end_mkdirs: * as an optimization. * -> mark #!... as ## */ - if (buf[0] == '#' && buf[1] == '!') + if (buf[0] == '#' && buf[1] == '!') buf[1] = '#'; first = 0; } @@ -1583,7 +1583,7 @@ again: if (pwtype == PW_MD5) ask_pw_md5(prompt, pass_want, pwd); else - ask_pw_sys(prompt, pass_want, pwd); + ask_pw_sys(prompt, pass_want, pwd); cnt = read_ax25(buf, sizeof(buf)-1); if (cnt <= 0) { @@ -1643,7 +1643,7 @@ again: break; case AF_ROSE: sax25.sax25_call = sockaddr.rose.srose_call; - break; + break; } ioctl(fds, SIOCAX25ADDUID, &sax25); close(fds); @@ -1659,36 +1659,36 @@ again: struct termios termios; char *shell = "/bin/sh"; - memset((char *) &termios, 0, sizeof(termios)); + memset((char *) &termios, 0, sizeof(termios)); - ioctl(0, TIOCSCTTY, (char *) 0); + ioctl(0, TIOCSCTTY, (char *) 0); termios.c_iflag = ICRNL | IXOFF; - termios.c_oflag = OPOST | ONLCR; - termios.c_cflag = CS8 | CREAD | CLOCAL; - termios.c_lflag = ISIG | ICANON; - termios.c_cc[VINTR] = /* 127 */ 0x03; - termios.c_cc[VQUIT] = 28; - termios.c_cc[VERASE] = 8; - termios.c_cc[VKILL] = 24; - termios.c_cc[VEOF] = 4; - cfsetispeed(&termios, B19200); - cfsetospeed(&termios, B19200); - tcsetattr(0, TCSANOW, &termios); + termios.c_oflag = OPOST | ONLCR; + termios.c_cflag = CS8 | CREAD | CLOCAL; + termios.c_lflag = ISIG | ICANON; + termios.c_cc[VINTR] = /* 127 */ 0x03; + termios.c_cc[VQUIT] = 28; + termios.c_cc[VERASE] = 8; + termios.c_cc[VKILL] = 24; + termios.c_cc[VEOF] = 4; + cfsetispeed(&termios, B19200); + cfsetospeed(&termios, B19200); + tcsetattr(0, TCSANOW, &termios); setutent(); - ut_line.ut_type = LOGIN_PROCESS; - ut_line.ut_pid = getpid(); - strncpy(ut_line.ut_line, ptyslave + 5, sizeof(ut_line.ut_line)); - strncpy(ut_line.ut_id, ptyslave + 8, sizeof(ut_line.ut_id)); - strncpy(ut_line.ut_user, "LOGIN", sizeof(ut_line.ut_user)); - strncpy(ut_line.ut_host, protocol, sizeof(ut_line.ut_host)); + ut_line.ut_type = LOGIN_PROCESS; + ut_line.ut_pid = getpid(); + strncpy(ut_line.ut_line, ptyslave + 5, sizeof(ut_line.ut_line)); + strncpy(ut_line.ut_id, ptyslave + 8, sizeof(ut_line.ut_id)); + strncpy(ut_line.ut_user, "LOGIN", sizeof(ut_line.ut_user)); + strncpy(ut_line.ut_host, protocol, sizeof(ut_line.ut_host)); gettimeofday(&tv, NULL); ut_line.ut_tv.tv_sec = tv.tv_sec; ut_line.ut_tv.tv_usec = tv.tv_usec; - ut_line.ut_addr = 0; - pututline(&ut_line); - endutent(); + ut_line.ut_addr = 0; + pututline(&ut_line); + endutent(); /* become process group leader, if we not already are */ if (getpid() != getsid(0)) { @@ -1696,8 +1696,8 @@ again: exit(1); } - chargc = 0; - envc = 0; + chargc = 0; + envc = 0; if (dumb_embedded_system) { int ret = -1; @@ -1709,18 +1709,18 @@ again: ret = -1; if (pw->pw_dir && *(pw->pw_dir)) p = pw->pw_dir; - ret = chdir(p); + ret = chdir(p); if (ret != 0) { p = "/tmp"; - chdir(p); + chdir(p); } - if ((envp[envc] = (char *) malloc(strlen(p)+6))) - sprintf(envp[envc++], "HOME=%s", p); - if ((envp[envc] = (char *) malloc(strlen(pw->pw_name)+6))) - sprintf(envp[envc++], "USER=%s", pw->pw_name); - if ((envp[envc] = (char *) malloc(strlen(pw->pw_name)+9))) - sprintf(envp[envc++], "LOGNAME=%s", pw->pw_name); + if ((envp[envc] = (char *) malloc(strlen(p)+6))) + sprintf(envp[envc++], "HOME=%s", p); + if ((envp[envc] = (char *) malloc(strlen(pw->pw_name)+6))) + sprintf(envp[envc++], "USER=%s", pw->pw_name); + if ((envp[envc] = (char *) malloc(strlen(pw->pw_name)+9))) + sprintf(envp[envc++], "LOGNAME=%s", pw->pw_name); if (pw->pw_shell && *(pw->pw_shell)) { shell = pw->pw_shell; @@ -1736,56 +1736,56 @@ again: } if (!p) p = shell; - chargv[chargc++] = p; - if ((envp[envc] = (char *) malloc(strlen(shell)+7))) - sprintf(envp[envc++], "SHELL=%s", shell); + chargv[chargc++] = p; + if ((envp[envc] = (char *) malloc(strlen(shell)+7))) + sprintf(envp[envc++], "SHELL=%s", shell); if (pw->pw_uid == 0) p = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"; else p = "/bin:/usr/bin:/usr/local/bin"; - if ((envp[envc] = (char *) malloc(strlen(p)+6))) - sprintf(envp[envc++], "PATH=%s", p); + if ((envp[envc] = (char *) malloc(strlen(p)+6))) + sprintf(envp[envc++], "PATH=%s", p); } else { - chargv[chargc++] = "/bin/login"; - chargv[chargc++] = "-p"; + chargv[chargc++] = "/bin/login"; + chargv[chargc++] = "-p"; /* there exist several conectps: - * Historicaly, the special character '+' in the password - * field indicated that users may login via ax25, netrom, rose, - * etc.. - but not via other protocols like telnet. - * This secures the digipeater from abuse by inet access of - * non-hams. - * On the other hand, this leads to the problem that telent - * via HF, pop3, etc.. do not work. - * The "pwcheck == 2 method means, that the password is used on - * every login mechanism other than this axspawn program; - * here we do not rely on the password - the ax25 call of - * the ham is enough. We have already checked above, that - * the call of the user is valid (and not root, httpd, etc..); - * thus this method is safe here. - * Another mechanism (pwcheck == 3) is to check if the gid - * equals to user_gid preference. I prefer this way, because - * this approach gives the chance to temporary lock a user - * out (abuse, ..) by changing his gid in passwd to for e.g. - * 65534 (nogroup). - */ + * Historicaly, the special character '+' in the password + * field indicated that users may login via ax25, netrom, rose, + * etc.. - but not via other protocols like telnet. + * This secures the digipeater from abuse by inet access of + * non-hams. + * On the other hand, this leads to the problem that telent + * via HF, pop3, etc.. do not work. + * The "pwcheck == 2 method means, that the password is used on + * every login mechanism other than this axspawn program; + * here we do not rely on the password - the ax25 call of + * the ham is enough. We have already checked above, that + * the call of the user is valid (and not root, httpd, etc..); + * thus this method is safe here. + * Another mechanism (pwcheck == 3) is to check if the gid + * equals to user_gid preference. I prefer this way, because + * this approach gives the chance to temporary lock a user + * out (abuse, ..) by changing his gid in passwd to for e.g. + * 65534 (nogroup). + */ chargv[chargc++] = "-h"; chargv[chargc++] = protocol; - if (pwtype != PW_CLEARTEXT /* PW_SYS or PW_MD5 are already authenticated */ + if (pwtype != PW_CLEARTEXT /* PW_SYS or PW_MD5 are already authenticated */ || pwcheck == 2 || (pwcheck == 3 && (pw->pw_gid == user_gid || is_guest)) || !strcmp(pw->pw_passwd, "+")) - chargv[chargc++] = "-f"; - chargv[chargc++] = as_user; + chargv[chargc++] = "-f"; + chargv[chargc++] = as_user; } - chargv[chargc] = NULL; - - if ((envp[envc] = (char *) malloc(30))) - sprintf(envp[envc++], "AXCALL=%s", call); - if ((envp[envc] = (char *) malloc(30))) - sprintf(envp[envc++], "CALL=%s", user); - if ((envp[envc] = (char *) malloc(30))) - sprintf(envp[envc++], "PROTOCOL=%s", protocol); + chargv[chargc] = NULL; + + if ((envp[envc] = (char *) malloc(30))) + sprintf(envp[envc++], "AXCALL=%s", call); + if ((envp[envc] = (char *) malloc(30))) + sprintf(envp[envc++], "CALL=%s", user); + if ((envp[envc] = (char *) malloc(30))) + sprintf(envp[envc++], "PROTOCOL=%s", protocol); if ((envp[envc] = (char *) malloc(30))) sprintf(envp[envc++], "TERM=dumb"); /* SuSE bug (dump - tsts) */ /* other useful defaults */ @@ -1800,51 +1800,51 @@ again: exit(1); if (setuid(pw->pw_uid) == -1) exit(1); - execve(shell, chargv, envp); + execve(shell, chargv, envp); /* point of no return */ exit(1); } - execve(chargv[0], chargv, envp); + execve(chargv[0], chargv, envp); /* point of no return */ exit(1); - } - else if (pid > 0) - { - child_pid = 0; - signal(SIGHUP, signal_handler); - signal(SIGTERM, signal_handler); - signal(SIGINT, signal_handler); - signal(SIGQUIT, signal_handler); - - while(1) - { - FD_ZERO(&fds_read); - FD_ZERO(&fds_err); - FD_SET(0, &fds_read); - FD_SET(0, &fds_err); - if (wqueue_length <= paclen*7) + } + else if (pid > 0) + { + child_pid = 0; + signal(SIGHUP, signal_handler); + signal(SIGTERM, signal_handler); + signal(SIGINT, signal_handler); + signal(SIGQUIT, signal_handler); + + while(1) + { + FD_ZERO(&fds_read); + FD_ZERO(&fds_err); + FD_SET(0, &fds_read); + FD_SET(0, &fds_err); + if (wqueue_length <= paclen*7) FD_SET(fdmaster, &fds_read); - FD_SET(fdmaster, &fds_err); + FD_SET(fdmaster, &fds_err); - k = select(fdmaster+1, &fds_read, NULL, &fds_err, NULL); + k = select(fdmaster+1, &fds_read, NULL, &fds_err, NULL); - if (k > 0) - { - if (FD_ISSET(0, &fds_err)) - { + if (k > 0) + { + if (FD_ISSET(0, &fds_err)) + { if (huffman) { sprintf(buf,"\r//COMP 0\r"); write_ax25(buf, strlen(buf), 1); sleep(EXITDELAY); - } - kill(pid, SIGHUP); - cleanup(ptyslave+5); - return 1; - } - - if (FD_ISSET(fdmaster, &fds_err)) - { + } + kill(pid, SIGHUP); + cleanup(ptyslave+5); + return 1; + } + + if (FD_ISSET(fdmaster, &fds_err)) + { /* give the last packet in the timer controlled sendqueue a chance.. */ if (wqueue_length) { continue; @@ -1853,28 +1853,28 @@ again: sprintf(buf,"\r//COMP 0\r"); write_ax25(buf, strlen(buf), 1); sleep(EXITDELAY); - } - cleanup(ptyslave+5); - return 1; - } - - if (FD_ISSET(0, &fds_read)) - { - cnt = read_ax25(buf, sizeof(buf)); - if (cnt < 0) /* Connection died */ - { - kill(pid, SIGHUP); - cleanup(ptyslave+5); - return 1; - } else - write(fdmaster, buf, cnt); - } - - if (FD_ISSET(fdmaster, &fds_read)) - { - cnt = read(fdmaster, buf, (huffman ? 254 : sizeof(buf))); - if (cnt < 0) - { + } + cleanup(ptyslave+5); + return 1; + } + + if (FD_ISSET(0, &fds_read)) + { + cnt = read_ax25(buf, sizeof(buf)); + if (cnt < 0) /* Connection died */ + { + kill(pid, SIGHUP); + cleanup(ptyslave+5); + return 1; + } else + write(fdmaster, buf, cnt); + } + + if (FD_ISSET(fdmaster, &fds_read)) + { + cnt = read(fdmaster, buf, (huffman ? 254 : sizeof(buf))); + if (cnt < 0) + { /* give the last packet in the timer controlled sendqueue a chance.. */ if (wqueue_length) { continue; @@ -1883,36 +1883,36 @@ again: sprintf(buf,"\r//COMP 0\r"); write_ax25(buf, strlen(buf), 1); sleep(EXITDELAY); - } - cleanup(ptyslave+5); - return 1; /* Child died */ - } - write_ax25(buf, cnt, 0); - } - } else - if (k < 0 && errno != EINTR) - { + } + cleanup(ptyslave+5); + return 1; /* Child died */ + } + write_ax25(buf, cnt, 0); + } + } else + if (k < 0 && errno != EINTR) + { if (huffman) { sprintf(buf,"\r//COMP 0\r"); write_ax25(buf, strlen(buf), 1); sleep(EXITDELAY); - } - - kill(pid, SIGHUP); /* just in case... */ - cleanup(ptyslave+5); - return 0; - } - } - } - else - { + } + + kill(pid, SIGHUP); /* just in case... */ + cleanup(ptyslave+5); + return 0; + } + } + } + else + { write_ax25_static_line(MSG_CANNOTFORK); - syslog(LOG_ERR, "cannot fork %m, closing connection to %s\n", call); - sleep(EXITDELAY); - return 1; - } + syslog(LOG_ERR, "cannot fork %m, closing connection to %s\n", call); + sleep(EXITDELAY); + return 1; + } - sleep(EXITDELAY); + sleep(EXITDELAY); return 0; } diff --git a/ax25/rxecho.c b/ax25/rxecho.c index e9c7daa..ab862bb 100644 --- a/ax25/rxecho.c +++ b/ax25/rxecho.c @@ -455,7 +455,7 @@ int main(int argc, char **argv) } for (;;) { - alen = sa_len; + alen = sa_len; if ((size = recvfrom(s, buf, 1500, 0, psa, &alen)) == -1) { if (logging) { @@ -479,11 +479,11 @@ int main(int argc, char **argv) for (p = list; p != NULL; p = p->next) #ifdef USE_SOCKADDR_SLL - if (p->from_idx == from_idx && (check_calls(p, buf, size) == 0)) { - sll.sll_ifindex = p->to_idx; + if (p->from_idx == from_idx && (check_calls(p, buf, size) == 0)) { + sll.sll_ifindex = p->to_idx; #else - if ((strcmp(p->from, from_dev_name) == 0) && (check_calls(p, buf, size) == 0)) { - strcpy(psa->sa_data, p->to); + if ((strcmp(p->from, from_dev_name) == 0) && (check_calls(p, buf, size) == 0)) { + strcpy(psa->sa_data, p->to); #endif /* * cave: alen (set by recvfrom()) may > salen diff --git a/hdlcutil/fl/xfhdlcchpar_main.cxx b/hdlcutil/fl/xfhdlcchpar_main.cxx index 7078d36..4b01138 100644 --- a/hdlcutil/fl/xfhdlcchpar_main.cxx +++ b/hdlcutil/fl/xfhdlcchpar_main.cxx @@ -79,7 +79,7 @@ static const char *usage_str = int main(int argc, char *argv[]) { - int c, i; + int c, i; int ret; struct hdrvc_channel_params cp; diff --git a/hdlcutil/fl/xfhdlcst_main.cxx b/hdlcutil/fl/xfhdlcst_main.cxx index 4542fe1..85a66db 100644 --- a/hdlcutil/fl/xfhdlcst_main.cxx +++ b/hdlcutil/fl/xfhdlcst_main.cxx @@ -70,7 +70,7 @@ static const char *usage_str = int main(int argc, char *argv[]) { - int c, i; + int c, i; int ret; struct hdrvc_channel_state cs; #ifdef HDRVC_KERNEL diff --git a/hdlcutil/fl/xfsmdiag.cxx b/hdlcutil/fl/xfsmdiag.cxx index 84c4bac..7232cfa 100644 --- a/hdlcutil/fl/xfsmdiag.cxx +++ b/hdlcutil/fl/xfsmdiag.cxx @@ -52,36 +52,36 @@ Fl_Window* create_the_forms() { { Fl_Group* o = scopemode = new Fl_Group(550, 10, 140, 130); o->align(FL_ALIGN_CENTER); { Fl_Box* o = new Fl_Box(550, 10, 140, 130); - o->box(FL_DOWN_BOX); + o->box(FL_DOWN_BOX); } { Fl_Check_Button* o = sm_off = new Fl_Check_Button(560, 20, 120, 20, "Off"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)cb_mode, (void*)(0)); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)cb_mode, (void*)(0)); } { Fl_Check_Button* o = sm_input = new Fl_Check_Button(560, 40, 120, 20, "Input"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)cb_mode, (void*)(1)); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)cb_mode, (void*)(1)); } { Fl_Check_Button* o = sm_demod = new Fl_Check_Button(560, 60, 120, 20, "Demodulator"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)cb_mode, (void*)(2)); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)cb_mode, (void*)(2)); } { Fl_Check_Button* o = sm_constell = new Fl_Check_Button(560, 80, 120, 20, "Constellation"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)cb_mode, (void*)(3)); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)cb_mode, (void*)(3)); } { Fl_Check_Button* o = sm_dcd = new Fl_Check_Button(560, 110, 120, 20, "Gated with DCD"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)cb_mode, (void*)(256)); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)cb_mode, (void*)(256)); } o->end(); } diff --git a/hdlcutil/fl/xfsmdiag_main.cxx b/hdlcutil/fl/xfsmdiag_main.cxx index 2e05c29..dce7029 100644 --- a/hdlcutil/fl/xfsmdiag_main.cxx +++ b/hdlcutil/fl/xfsmdiag_main.cxx @@ -94,7 +94,7 @@ void scope::resize(int xx, int yy, int ww, int hh) void scope::draw() { GC gc; - XGCValues gcv; + XGCValues gcv; /* cannot use draw_box(); as it clears the whole window -> flicker */ /* from fl_boxtype.C, fl_down_frame */ @@ -178,17 +178,17 @@ void scope::mode(int dmode) void scope::clear(void) { GC gc; - XGCValues gcv; + XGCValues gcv; if (!pixmalloc) return; gcv.line_width = 1; - gcv.line_style = LineSolid; + gcv.line_style = LineSolid; gcv.fill_style = FillSolid; - gc = XCreateGC(fl_display, pixmap, GCLineWidth | GCLineStyle | GCFillStyle, &gcv); - XSetState(fl_display, gc, col_background, col_background, GXcopy, AllPlanes); + gc = XCreateGC(fl_display, pixmap, GCLineWidth | GCLineStyle | GCFillStyle, &gcv); + XSetState(fl_display, gc, col_background, col_background, GXcopy, AllPlanes); XFillRectangle(fl_display, pixmap, gc, 0, 0, W, H); - XFreeGC(fl_display, gc); + XFreeGC(fl_display, gc); redraw(); } @@ -201,8 +201,8 @@ void scope::clear(void) void scope::drawdata(short data[], int len, int xm) { int cnt; - GC gc; - XGCValues gcv; + GC gc; + XGCValues gcv; mode(); if (!pixmalloc || (drawmode != HDRVC_DIAGMODE_CONSTELLATION && @@ -210,8 +210,8 @@ void scope::drawdata(short data[], int len, int xm) drawmode != HDRVC_DIAGMODE_DEMOD)) return; gcv.line_width = 1; - gcv.line_style = LineSolid; - gc = XCreateGC(fl_display, pixmap, GCLineWidth | GCLineStyle, &gcv); + gcv.line_style = LineSolid; + gc = XCreateGC(fl_display, pixmap, GCLineWidth | GCLineStyle, &gcv); if (drawmode == HDRVC_DIAGMODE_CONSTELLATION) { #define XCOORD(x) ((SHRT_MAX - (int)(x)) * W / USHRT_MAX) #define YCOORD(y) ((SHRT_MAX - (int)(y)) * H / USHRT_MAX) @@ -241,7 +241,7 @@ void scope::drawdata(short data[], int len, int xm) #undef XCOORD #undef YCOORD } - XFreeGC(fl_display, gc); + XFreeGC(fl_display, gc); redraw(); } @@ -349,7 +349,7 @@ static const char *usage_str = int main(int argc, char *argv[]) { - int c, i; + int c, i; int ret; unsigned int ifflags; char name[64]; diff --git a/hdlcutil/fl/xfsmmixer.cxx b/hdlcutil/fl/xfsmmixer.cxx index 57b5306..b5ba9b1 100644 --- a/hdlcutil/fl/xfsmmixer.cxx +++ b/hdlcutil/fl/xfsmmixer.cxx @@ -71,70 +71,70 @@ Fl_Window* create_form_ad1848() { { Fl_Group* o = ad1848_srcr = new Fl_Group(180, 150, 100, 120); o->align(FL_ALIGN_CENTER); { Fl_Box* o = new Fl_Box(180, 150, 100, 120); - o->box(FL_DOWN_BOX); + o->box(FL_DOWN_BOX); } { Fl_Check_Button* o = ad1848_srcr_line = new Fl_Check_Button(190, 180, 60, 20, "Line"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ad1848); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ad1848); } { Fl_Check_Button* o = ad1848_srcr_aux1 = new Fl_Check_Button(190, 200, 60, 20, "Aux1"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ad1848); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ad1848); } { Fl_Check_Button* o = ad1848_srcr_mic = new Fl_Check_Button(190, 220, 60, 20, "Mic"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ad1848); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ad1848); } { Fl_Check_Button* o = ad1848_srcr_dac = new Fl_Check_Button(190, 240, 60, 20, "DAC"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ad1848); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ad1848); } { Fl_Box* o = new Fl_Box(190, 160, 60, 20, "Right source"); - o->box(FL_FLAT_BOX); - o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + o->box(FL_FLAT_BOX); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); } o->end(); } { Fl_Group* o = ad1848_srcl = new Fl_Group(180, 20, 100, 120); o->align(FL_ALIGN_CENTER); { Fl_Box* o = new Fl_Box(180, 20, 100, 120); - o->box(FL_DOWN_BOX); + o->box(FL_DOWN_BOX); } { Fl_Box* o = new Fl_Box(190, 30, 60, 20, "Left source"); - o->box(FL_FLAT_BOX); - o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + o->box(FL_FLAT_BOX); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); } { Fl_Check_Button* o = ad1848_srcl_line = new Fl_Check_Button(190, 50, 60, 20, "Line"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ad1848); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ad1848); } { Fl_Check_Button* o = ad1848_srcl_aux1 = new Fl_Check_Button(190, 70, 60, 20, "Aux1"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ad1848); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ad1848); } { Fl_Check_Button* o = ad1848_srcl_mic = new Fl_Check_Button(190, 90, 60, 20, "Mic"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ad1848); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ad1848); } { Fl_Check_Button* o = ad1848_srcl_dac = new Fl_Check_Button(190, 110, 60, 20, "DAC"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ad1848); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ad1848); } o->end(); } @@ -216,29 +216,29 @@ Fl_Window* create_form_ct1345() { { Fl_Group* o = ct1345_src = new Fl_Group(100, 20, 70, 100); o->align(FL_ALIGN_CENTER); { Fl_Box* o = new Fl_Box(100, 20, 70, 100); - o->box(FL_DOWN_BOX); + o->box(FL_DOWN_BOX); } { Fl_Check_Button* o = ct1345_src_mic = new Fl_Check_Button(110, 50, 50, 20, "Mic"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1345); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1345); } { Fl_Check_Button* o = ct1345_src_cd = new Fl_Check_Button(110, 70, 50, 20, "CD"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1345); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1345); } { Fl_Check_Button* o = ct1345_src_line = new Fl_Check_Button(110, 90, 50, 20, "Line"); - o->type(102); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1345); + o->type(102); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1345); } { Fl_Box* o = new Fl_Box(110, 30, 50, 20, "Source"); - o->box(FL_FLAT_BOX); - o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + o->box(FL_FLAT_BOX); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); } o->end(); } @@ -342,92 +342,92 @@ Fl_Window* create_form_ct1745() { { Fl_Group* o = ct1745_srcl = new Fl_Group(180, 20, 110, 180); o->align(FL_ALIGN_CENTER); { Fl_Box* o = new Fl_Box(180, 20, 110, 180); - o->box(FL_DOWN_BOX); + o->box(FL_DOWN_BOX); } { Fl_Box* o = new Fl_Box(191, 29, 89, 18, "Left source"); - o->box(FL_FLAT_BOX); - o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + o->box(FL_FLAT_BOX); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); } { Fl_Check_Button* o = ct1745_srcl_mic = new Fl_Check_Button(190, 50, 90, 20, "Mic"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcl_cdl = new Fl_Check_Button(190, 70, 90, 20, "CD left"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcl_cdr = new Fl_Check_Button(190, 90, 90, 20, "CD right"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcl_linel = new Fl_Check_Button(190, 110, 90, 20, "Line left"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcl_midil = new Fl_Check_Button(190, 150, 90, 20, "MIDI left"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcl_midir = new Fl_Check_Button(190, 170, 90, 20, "MIDI right"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcl_liner = new Fl_Check_Button(190, 130, 90, 20, "Line right"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } o->end(); } { Fl_Group* o = ct1745_srcr = new Fl_Group(300, 20, 110, 180); o->align(FL_ALIGN_CENTER); { Fl_Box* o = new Fl_Box(300, 20, 110, 180); - o->box(FL_DOWN_BOX); + o->box(FL_DOWN_BOX); } { Fl_Box* o = new Fl_Box(311, 29, 89, 18, "Right source"); - o->box(FL_FLAT_BOX); - o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + o->box(FL_FLAT_BOX); + o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); } { Fl_Check_Button* o = ct1745_srcr_mic = new Fl_Check_Button(310, 50, 90, 20, "Mic"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcr_cdl = new Fl_Check_Button(310, 70, 90, 20, "CD left"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcr_cdr = new Fl_Check_Button(310, 90, 90, 20, "CD right"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcr_linel = new Fl_Check_Button(310, 110, 90, 20, "Line left"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcr_midil = new Fl_Check_Button(310, 150, 90, 20, "MIDI left"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcr_midir = new Fl_Check_Button(310, 170, 90, 20, "MIDI right"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } { Fl_Check_Button* o = ct1745_srcr_liner = new Fl_Check_Button(310, 130, 90, 20, "Line right"); - o->down_box(FL_DIAMOND_DOWN_BOX); - o->selection_color(3); - o->callback((Fl_Callback*)update_ct1745); + o->down_box(FL_DIAMOND_DOWN_BOX); + o->selection_color(3); + o->callback((Fl_Callback*)update_ct1745); } o->end(); } diff --git a/hdlcutil/fl/xfsmmixer_main.cxx b/hdlcutil/fl/xfsmmixer_main.cxx index 83774a0..b33533f 100644 --- a/hdlcutil/fl/xfsmmixer_main.cxx +++ b/hdlcutil/fl/xfsmmixer_main.cxx @@ -50,7 +50,7 @@ static unsigned int mixdevice; static int do_mix_ioctl(int cmd, struct sm_mixer_data *mixdat) { - struct sm_ioctl par; + struct sm_ioctl par; int i; par.cmd = cmd; @@ -309,7 +309,7 @@ static const char *usage_str = int main(int argc, char *argv[]) { - int c, i; + int c, i; struct sm_mixer_data mixdat; unsigned char mdata; diff --git a/hdlcutil/hdlcdrv.9 b/hdlcutil/hdlcdrv.9 index 31b0e7e..e76c391 100644 --- a/hdlcutil/hdlcdrv.9 +++ b/hdlcutil/hdlcdrv.9 @@ -118,11 +118,11 @@ the HDLC driver: .nf struct hdlcdrv_ops { - const char *\fIdrvname\fP; - const char *\fIdrvinfo\fP; - int (*\fIopen\fP)(struct device *); - int (*\fIclose\fP)(struct device *); - int (*\fIioctl\fP)(struct device *, struct ifreq *, int); + const char *\fIdrvname\fP; + const char *\fIdrvinfo\fP; + int (*\fIopen\fP)(struct device *); + int (*\fIclose\fP)(struct device *); + int (*\fIioctl\fP)(struct device *, struct ifreq *, int); }; .fi @@ -149,14 +149,14 @@ from and to the driver using the following struct: .nf struct hdlcdrv_ioctl { - int cmd; - union { - struct hdlcdrv_params mp; - struct hdlcdrv_channel_params cp; - struct hdlcdrv_channel_state cs; - unsigned int calibrate; - unsigned char bits; - } data; + int cmd; + union { + struct hdlcdrv_params mp; + struct hdlcdrv_channel_params cp; + struct hdlcdrv_channel_state cs; + unsigned int calibrate; + unsigned char bits; + } data; }; .fi diff --git a/hdlcutil/hdrvcomm.c b/hdlcutil/hdrvcomm.c index d27a37f..c362c1b 100644 --- a/hdlcutil/hdrvcomm.c +++ b/hdlcutil/hdrvcomm.c @@ -244,7 +244,7 @@ void hdrvc_init(void) fprintf(stderr, "%s: Error %s (%i), cannot ioctl SIOCGIFHWADDR %s\n", prg_name, strerror(errno), errno, if_name); exit(-1); - } + } if (ifr.ifr_hwaddr.sa_family != ARPHRD_AX25) { fprintf(stderr, "%s: Error, interface %s not AX25 (%i)\n", prg_name, if_name, ifr.ifr_hwaddr.sa_family); diff --git a/hdlcutil/hdrvcomm.h b/hdlcutil/hdrvcomm.h index fbb4965..520f2d9 100644 --- a/hdlcutil/hdrvcomm.h +++ b/hdlcutil/hdrvcomm.h @@ -49,22 +49,22 @@ extern "C" { /* ---------------------------------------------------------------------- */ struct hdrvc_channel_params { - int tx_delay; /* the transmitter keyup delay in 10ms units */ - int tx_tail; /* the transmitter keyoff delay in 10ms units */ - int slottime; /* the slottime in 10ms; usually 10 = 100ms */ - int ppersist; /* the p-persistence 0..255 */ - int fulldup; /* some driver do not support full duplex, setting */ - /* this just makes them send even if DCD is on */ + int tx_delay; /* the transmitter keyup delay in 10ms units */ + int tx_tail; /* the transmitter keyoff delay in 10ms units */ + int slottime; /* the slottime in 10ms; usually 10 = 100ms */ + int ppersist; /* the p-persistence 0..255 */ + int fulldup; /* some driver do not support full duplex, setting */ + /* this just makes them send even if DCD is on */ }; struct hdrvc_channel_state { - int ptt; - int dcd; - int ptt_keyed; - unsigned long tx_packets; - unsigned long tx_errors; - unsigned long rx_packets; - unsigned long rx_errors; + int ptt; + int dcd; + int ptt_keyed; + unsigned long tx_packets; + unsigned long tx_errors; + unsigned long rx_packets; + unsigned long rx_errors; }; /* ---------------------------------------------------------------------- */ diff --git a/hdlcutil/sethdlc.c b/hdlcutil/sethdlc.c index 3389a9e..a9f16b3 100644 --- a/hdlcutil/sethdlc.c +++ b/hdlcutil/sethdlc.c @@ -222,7 +222,7 @@ static void print_bits(int (*bitproc)(void)) if (errno == EAGAIN) return; fprintf(stderr, "%s: Error %s (%i), cannot ioctl\n", - progname, strerror(errno), errno); + progname, strerror(errno), errno); return; } strcpy(cp = str, "00000000"); diff --git a/hdlcutil/smdiag.c b/hdlcutil/smdiag.c index 6f9a79b..16d34f0 100644 --- a/hdlcutil/smdiag.c +++ b/hdlcutil/smdiag.c @@ -86,21 +86,21 @@ static int x_error_handler(Display *disp, XErrorEvent *evt) static int openwindow(char *disp, int constell, int samplesperbit) { - XSetWindowAttributes attr; - XGCValues gr_values; - XColor color, dummy; - XSizeHints sizehints; - - if (!(display = XOpenDisplay(NULL))) - return -1; - XSetErrorHandler(x_error_handler); - XAllocNamedColor(display, DefaultColormap(display, 0), "red", - &color, &dummy); + XSetWindowAttributes attr; + XGCValues gr_values; + XColor color, dummy; + XSizeHints sizehints; + + if (!(display = XOpenDisplay(NULL))) + return -1; + XSetErrorHandler(x_error_handler); + XAllocNamedColor(display, DefaultColormap(display, 0), "red", + &color, &dummy); col_zeroline = color.pixel; col_background = WhitePixel(display, 0); col_trace = BlackPixel(display, 0); - attr.background_pixel = col_background; - if (!(window = XCreateWindow(display, XRootWindow(display, 0), + attr.background_pixel = col_background; + if (!(window = XCreateWindow(display, XRootWindow(display, 0), 200, 200, WIDTH, HEIGHT, 5, DefaultDepth(display, 0), InputOutput, DefaultVisual(display, 0), @@ -113,28 +113,28 @@ static int openwindow(char *disp, int constell, int samplesperbit) fprintf(stderr, "smdiag: unable to open offscreen pixmap\n"); exit(1); } - xmul = WIDTH / (2*(samplesperbit > 0 ? samplesperbit : 1)); - XSelectInput(display, window, KeyPressMask | StructureNotifyMask + xmul = WIDTH / (2*(samplesperbit > 0 ? samplesperbit : 1)); + XSelectInput(display, window, KeyPressMask | StructureNotifyMask | ExposureMask) ; - XAllocNamedColor(display, DefaultColormap(display, 0), "red", - &color, &dummy); - gr_values.foreground = col_trace; - gr_values.line_width = 1; - gr_values.line_style = LineSolid; - gr_context = XCreateGC(display, window, GCForeground | GCLineWidth | - GCLineStyle, &gr_values); - XStoreName(display, window, "diagnostics"); - /* - * Do not allow the window to be resized - */ - memset(&sizehints, 0, sizeof(sizehints)); - sizehints.min_width = sizehints.max_width = WIDTH; - sizehints.min_height = sizehints.max_height = HEIGHT; - sizehints.flags = PMinSize | PMaxSize; - XSetWMNormalHints(display, window, &sizehints); - XMapWindow(display, window); - XSynchronize(display, 1); - return 0; + XAllocNamedColor(display, DefaultColormap(display, 0), "red", + &color, &dummy); + gr_values.foreground = col_trace; + gr_values.line_width = 1; + gr_values.line_style = LineSolid; + gr_context = XCreateGC(display, window, GCForeground | GCLineWidth | + GCLineStyle, &gr_values); + XStoreName(display, window, "diagnostics"); + /* + * Do not allow the window to be resized + */ + memset(&sizehints, 0, sizeof(sizehints)); + sizehints.min_width = sizehints.max_width = WIDTH; + sizehints.min_height = sizehints.max_height = HEIGHT; + sizehints.flags = PMinSize | PMaxSize; + XSetWMNormalHints(display, window, &sizehints); + XMapWindow(display, window); + XSynchronize(display, 1); + return 0; } #undef WIDTH @@ -144,11 +144,11 @@ static int openwindow(char *disp, int constell, int samplesperbit) static void closewindow(void) { - if (!display) - return; - XDestroyWindow(display, window); - XCloseDisplay(display); - display = NULL; + if (!display) + return; + XDestroyWindow(display, window); + XCloseDisplay(display); + display = NULL; } /* ---------------------------------------------------------------------- */ @@ -159,17 +159,17 @@ static void closewindow(void) static void drawdata(short *data, int len, int replace, int xm) { int cnt; - GC gc; - XGCValues gcv; - XWindowAttributes winattrs; + GC gc; + XGCValues gcv; + XWindowAttributes winattrs; - if (!display || !pixmap) - return; - XGetWindowAttributes(display, window, &winattrs); + if (!display || !pixmap) + return; + XGetWindowAttributes(display, window, &winattrs); gcv.line_width = 1; - gcv.line_style = LineSolid; - gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv); - XSetState(display, gc, col_background, col_background, GXcopy, + gcv.line_style = LineSolid; + gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv); + XSetState(display, gc, col_background, col_background, GXcopy, AllPlanes); if (replace) XFillRectangle(display, pixmap, gc, 0, 0, @@ -177,16 +177,16 @@ static void drawdata(short *data, int len, int replace, int xm) else XCopyArea(display, window, pixmap, gr_context, 0, 0, winattrs.width, winattrs.height, 0, 0); - XSetForeground(display, gc, col_trace); + XSetForeground(display, gc, col_trace); for (cnt = 0; cnt < len-1; cnt++) XDrawLine(display, pixmap, gc, XCOORD(cnt), YCOORD(data[cnt]), XCOORD(cnt+1), YCOORD(data[cnt+1])); - XSetForeground(display, gc, col_zeroline); + XSetForeground(display, gc, col_zeroline); XDrawLine(display, pixmap, gc, 0, YCOORD(0), winattrs.width, YCOORD(0)); XCopyArea(display, pixmap, window, gr_context, 0, 0, winattrs.width, - winattrs.height, 0, 0); - XFreeGC(display, gc); + winattrs.height, 0, 0); + XFreeGC(display, gc); XSync(display, 0); } @@ -201,30 +201,30 @@ static void drawdata(short *data, int len, int replace, int xm) static void drawconstell(short *data, int len) { int cnt; - GC gc; - XGCValues gcv; - XWindowAttributes winattrs; + GC gc; + XGCValues gcv; + XWindowAttributes winattrs; - if (!display || !pixmap) - return; - XGetWindowAttributes(display, window, &winattrs); + if (!display || !pixmap) + return; + XGetWindowAttributes(display, window, &winattrs); gcv.line_width = 1; - gcv.line_style = LineSolid; - gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv); - XSetState(display, gc, col_background, col_background, GXcopy, + gcv.line_style = LineSolid; + gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv); + XSetState(display, gc, col_background, col_background, GXcopy, AllPlanes); XCopyArea(display, window, pixmap, gr_context, 0, 0, winattrs.width, winattrs.height, 0, 0); - XSetForeground(display, gc, col_trace); + XSetForeground(display, gc, col_trace); for (cnt = 0; cnt < len-1; cnt += 2) XDrawPoint(display, pixmap, gc, XCOORD(data[cnt]), YCOORD(data[cnt+1])); - XSetForeground(display, gc, col_zeroline); + XSetForeground(display, gc, col_zeroline); XDrawLine(display, pixmap, gc, 0, YCOORD(0), winattrs.width, YCOORD(0)); XDrawLine(display, pixmap, gc, XCOORD(0), 0, XCOORD(0), winattrs.height); XCopyArea(display, pixmap, window, gr_context, 0, 0, winattrs.width, - winattrs.height, 0, 0); - XFreeGC(display, gc); + winattrs.height, 0, 0); + XFreeGC(display, gc); XSync(display, 0); } @@ -235,47 +235,47 @@ static void drawconstell(short *data, int len) static void clearwindow(void) { - XWindowAttributes winattrs; + XWindowAttributes winattrs; GC gc; - XGCValues gcv; + XGCValues gcv; - if (!display || !pixmap) - return; - XGetWindowAttributes(display, window, &winattrs); + if (!display || !pixmap) + return; + XGetWindowAttributes(display, window, &winattrs); gcv.line_width = 1; - gcv.line_style = LineSolid; - gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv); - XSetState(display, gc, col_background, col_background, GXcopy, + gcv.line_style = LineSolid; + gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv); + XSetState(display, gc, col_background, col_background, GXcopy, AllPlanes); XFillRectangle(display, pixmap, gc, 0, 0, winattrs.width, winattrs.height); - XSetForeground(display, gc, col_zeroline); - XClearArea(display, window, 0, 0, 0, 0, False); + XSetForeground(display, gc, col_zeroline); + XClearArea(display, window, 0, 0, 0, 0, False); XCopyArea(display, pixmap, window, gr_context, 0, 0, winattrs.width, - winattrs.height, 0, 0); - XFreeGC(display, gc); + winattrs.height, 0, 0); + XFreeGC(display, gc); } /* ---------------------------------------------------------------------- */ static Bool predicate(Display *display, XEvent *event, char *arg) { - return True; + return True; } /* ---------------------------------------------------------------------- */ static char *getkey(void) { - XWindowAttributes winattrs; - XEvent evt; - static char kbuf[32]; - int i; + XWindowAttributes winattrs; + XEvent evt; + static char kbuf[32]; + int i; - if (!display) - return NULL; + if (!display) + return NULL; XSync(display, 0); - while (XCheckIfEvent(display, &evt, predicate, NULL)) { + while (XCheckIfEvent(display, &evt, predicate, NULL)) { switch (evt.type) { case KeyPress: i = XLookupString((XKeyEvent *)&evt, kbuf, sizeof(kbuf)-1, @@ -296,8 +296,8 @@ static char *getkey(void) default: break; } - } - return NULL; + } + return NULL; } /* ---------------------------------------------------------------------- */ diff --git a/hdlcutil/smmixer.c b/hdlcutil/smmixer.c index 473b3a6..8efeac8 100644 --- a/hdlcutil/smmixer.c +++ b/hdlcutil/smmixer.c @@ -159,7 +159,7 @@ static void display_mixer_cs423x(void) (data & 0x40) ? "output muted, " : "", (data & 0x20) ? "bypass, " : "", (int)(data & 0xf) * (-3)); - data = get_mixer_reg(27); + data = get_mixer_reg(27); if (data & 0x80) printf("Left output: muted\n"); else @@ -314,15 +314,15 @@ static void display_mixer_ct1745(void) static int parse_ad_src(const char *cp) { - if (!strcasecmp(cp, "line")) - return 0; - if (!strcasecmp(cp, "aux1")) - return 1; - if (!strcasecmp(cp, "mic")) - return 2; - if (!strcasecmp(cp, "dac")) - return 3; - return -1; + if (!strcasecmp(cp, "line")) + return 0; + if (!strcasecmp(cp, "aux1")) + return 1; + if (!strcasecmp(cp, "mic")) + return 2; + if (!strcasecmp(cp, "dac")) + return 3; + return -1; } /* ---------------------------------------------------------------------- */ diff --git a/kiss/kissattach.c b/kiss/kissattach.c index e61eabb..0f62892 100644 --- a/kiss/kissattach.c +++ b/kiss/kissattach.c @@ -70,7 +70,7 @@ static int readconfig(char *port) if ((fp = fopen(CONF_AXPORTS_FILE, "r")) == NULL) { fprintf(stderr, "%s: cannot open axports file %s\n", - progname, CONF_AXPORTS_FILE); + progname, CONF_AXPORTS_FILE); return FALSE; } @@ -214,7 +214,7 @@ static int startiface(char *dev, struct hostent *hp) static void usage(void) { - fprintf(stderr, "usage: %s [-b] [-l] [-m mtu] [-v] tty port [inetaddr]\n", progname); + fprintf(stderr, "usage: %s [-b] [-l] [-m mtu] [-v] tty port [inetaddr]\n", progname); } int main(int argc, char *argv[]) @@ -224,7 +224,7 @@ int main(int argc, char *argv[]) char dev[64]; int v = 4; char *namepts = NULL; /* name of the unix98 pts slave, which - * the client has to use */ + * the client has to use */ struct hostent *hp = NULL; progname = kiss_basename(argv[0]); @@ -291,7 +291,7 @@ int main(int argc, char *argv[]) if (!readconfig(portname)) return 1; - if (inetaddr && (hp = gethostbyname(inetaddr)) == NULL) { + if (inetaddr && (hp = gethostbyname(inetaddr)) == NULL) { fprintf(stderr, "%s: invalid internet name/address - %s\n", progname, inetaddr); return 1; } diff --git a/kiss/kissnetd.c b/kiss/kissnetd.c index 903ee22..0aab58f 100644 --- a/kiss/kissnetd.c +++ b/kiss/kissnetd.c @@ -145,7 +145,7 @@ static void ReopenPort(int PortNumber) } else { if (PortList[PortNumber]->Fd == -1) { syslog(LOG_WARNING, "kissnetd : Cannot reopen port ptmx (slave %s) : not supported by ptmx-device\n", - PortList[PortNumber]->namepts); + PortList[PortNumber]->namepts); if (VerboseMode) { sprintf(MyString, "cannot reopen ptmx (slave %s).", PortList[PortNumber]->namepts); perror(MyString); @@ -153,7 +153,7 @@ static void ReopenPort(int PortNumber) return; } syslog(LOG_WARNING, "kissnetd : Trying to poll port ptmx (slave %s).\n", - PortList[PortNumber]->namepts); + PortList[PortNumber]->namepts); PortList[PortNumber]->is_active = 1; } } diff --git a/kiss/mkiss.c b/kiss/mkiss.c index 3abcbbd..fbb1e53 100644 --- a/kiss/mkiss.c +++ b/kiss/mkiss.c @@ -159,13 +159,13 @@ static int poll(int fd, int ports) static int put_ubyte(unsigned char* s, u16* crc, unsigned char c, int usecrc) { - int len = 1; + int len = 1; - if (c == FEND) { + if (c == FEND) { *s++ = FESC; *s++ = TFEND; len++; - } else { + } else { *s++ = c; if (c == FESC) { *s++ = TFESC; @@ -205,7 +205,7 @@ static int kiss_tx(int fd, int port, unsigned char *s, int len, int usecrc) */ *ptr++ = FEND; - if (usecrc == FLEX_CRC) { + if (usecrc == FLEX_CRC) { crc = 0xffff; ptr += put_ubyte(ptr, &crc, CRCTYP, usecrc); c = *s++; @@ -445,13 +445,13 @@ int main(int argc, char *argv[]) hwflag = TRUE; break; case 'l': - logging = TRUE; - break; + logging = TRUE; + break; case 'p': pollspeed = atoi(optarg); pollinterval.tv_sec = pollspeed / 10; pollinterval.tv_usec = (pollspeed % 10) * 100000L; - break; + break; case 's': speed = atoi(optarg); break; @@ -482,7 +482,7 @@ int main(int argc, char *argv[]) return 1; } - numptys = argc - optind - 1; + numptys = argc - optind - 1; if ((numptys + ptmxdevices) > 16) { fprintf(stderr, "mkiss: max 16 pty interfaces allowed.\n"); return 1; diff --git a/kiss/net2kiss.c b/kiss/net2kiss.c index d3b5234..27cd702 100644 --- a/kiss/net2kiss.c +++ b/kiss/net2kiss.c @@ -243,7 +243,7 @@ static int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) { char line[PATH_MAX]; - const char *cp1, *cp2; + const char *cp1, *cp2; int master, slave; struct group *gr = getgrnam("tty"); @@ -404,7 +404,7 @@ static int doio(int fdif, int fdpty, char *ifaddr) unsigned char pktbuf[2048]; unsigned char *pktptr = pktbuf; unsigned char pktstate = KISS_HUNT; - unsigned char obuf[16384]; + unsigned char obuf[16384]; unsigned int ob_wp = 0, ob_rp = 0, ob_wpx; int i; fd_set rmask, wmask; @@ -418,9 +418,9 @@ static int doio(int fdif, int fdpty, char *ifaddr) #define ADD_KISSCHAR(c) \ if (((c) & 0xff) == KISS_FEND) \ - { ADD_CHAR(KISS_FESC); ADD_CHAR(KISS_TFEND); } \ + { ADD_CHAR(KISS_FESC); ADD_CHAR(KISS_TFEND); } \ else if (((c) & 0xff) == KISS_FESC) \ - { ADD_CHAR(KISS_FESC); ADD_CHAR(KISS_TFESC); } \ + { ADD_CHAR(KISS_FESC); ADD_CHAR(KISS_TFESC); } \ else { ADD_CHAR(c); } for (;;) { @@ -622,7 +622,7 @@ int main(int argc, char *argv[]) memcpy(ifr.ifr_name, name_iface, IFNAMSIZ); if (ioctl(fdif, SIOCGIFFLAGS, &ifr) < 0) die("ioctl SIOCGIFFLAGS"); - ifr_new = ifr; + ifr_new = ifr; ifr_new.ifr_flags |= if_newflags; if (ioctl(fdif, SIOCSIFFLAGS, &ifr_new) < 0) die("ioctl SIOCSIFFLAGS"); @@ -674,7 +674,7 @@ int main(int argc, char *argv[]) } else { /* * try to reopen master - */ + */ if (verbose) printf("reopening master tty: %s\n", master_name); close(fdpty); diff --git a/netrom/netromr.c b/netrom/netromr.c index 3cbaeb4..1f2e89d 100644 --- a/netrom/netromr.c +++ b/netrom/netromr.c @@ -48,7 +48,7 @@ static int validcallsign(ax25_address *a) } return FALSE; - } + } return TRUE; } diff --git a/netrom/nrsdrv.c b/netrom/nrsdrv.c index c58c13f..52ad0a4 100644 --- a/netrom/nrsdrv.c +++ b/netrom/nrsdrv.c @@ -81,16 +81,16 @@ static void key_rts(int fd) /* Wait for CTS to be low */ while (1) { /* Get CTS status */ - if (ioctl(fd, TIOCMGET, &status) < 0) { + if (ioctl(fd, TIOCMGET, &status) < 0) { syslog(LOG_INFO|LOG_ERR, "TIOCMGET failed: flowcontrol disabled (%m)\n"); flowcontrol = 0; - return; - } + return; + } if (status & TIOCM_CTS) { if (debugging) { fprintf(stderr,"CTS high: waiting\n"); } - ioctl(fd, TIOCMIWAIT, &status); + ioctl(fd, TIOCMIWAIT, &status); } else { break; } @@ -100,10 +100,10 @@ static void key_rts(int fd) fprintf(stderr,"CTS low: keying RTS\n"); } status |= TIOCM_RTS | TIOCM_DTR; - if (ioctl(fd, TIOCMSET, &status) < 0) { + if (ioctl(fd, TIOCMSET, &status) < 0) { syslog(LOG_INFO|LOG_ERR, "TIOCMGET failed: flowcontrol disabled (%m)\n"); flowcontrol = 0; - } + } } static void unkey_rts(int fd) @@ -116,13 +116,13 @@ static void unkey_rts(int fd) if (debugging) { fprintf(stderr,"Transmission finished: unkeying RTS\n"); } - ioctl(fd, TIOCMGET, &status); + ioctl(fd, TIOCMGET, &status); status &= ~TIOCM_RTS; - status |= TIOCM_DTR; - if (ioctl(fd, TIOCMSET, &status) < 0) { + status |= TIOCM_DTR; + if (ioctl(fd, TIOCMSET, &status) < 0) { syslog(LOG_INFO|LOG_ERR, "TIOCMGET failed: flowcontrol disabled (%m)\n"); flowcontrol = 0; - } + } } static void nrs_esc(unsigned char *s, int len) diff --git a/rose/rsmemsiz.c b/rose/rsmemsiz.c index bdddb45..14abbfe 100644 --- a/rose/rsmemsiz.c +++ b/rose/rsmemsiz.c @@ -163,7 +163,7 @@ int main(int argc, char **argv) upminutes = upminutes % 60; fprintf(stdout, "Uptime: "); - if (updays) + if (updays) fprintf(stdout, "%d day%s, ", updays, (updays != 1) ? "s" : ""); if (uphours) @@ -171,7 +171,7 @@ int main(int argc, char **argv) fprintf(stdout, "%d minute%s\r", upminutes, (upminutes != 1) ? "s" : ""); loadavg(&av[0], &av[1], &av[2]); - fprintf(stdout, "Load average: %.2f, %.2f, %.2f\r", av[0], av[1], av[2]); + fprintf(stdout, "Load average: %.2f, %.2f, %.2f\r", av[0], av[1], av[2]); if (!(mem = meminfo()) || mem[meminfo_main][meminfo_total] == 0) { /* cannot normalize mem usage */ @@ -180,10 +180,10 @@ int main(int argc, char **argv) fprintf(stdout, "Memory: %5d KB available, %5d KB used, %5d KB free\r", mem[meminfo_main][meminfo_total] >> 10, (mem[meminfo_main][meminfo_used] - - mem[meminfo_main][meminfo_buffers] - + mem[meminfo_main][meminfo_buffers] - mem[meminfo_total][meminfo_cached]) >> 10, (mem[meminfo_main][meminfo_free] + - mem[meminfo_main][meminfo_buffers] + + mem[meminfo_main][meminfo_buffers] + mem[meminfo_total][meminfo_cached]) >> 10); fprintf(stdout, "Swap: %5d KB available, %5d KB used, %5d KB free\r", diff --git a/tcpip/ttylinkd.c b/tcpip/ttylinkd.c index 2babaeb..86287d4 100644 --- a/tcpip/ttylinkd.c +++ b/tcpip/ttylinkd.c @@ -265,7 +265,7 @@ int main(int argc, char *argv[]) memset((char*)&msg_sa, 0, sizeof(msg_sa)); msg_sa.sa_family = AF_INET; - msg_sin = (struct sockaddr_in*)&msg_sa; + msg_sin = (struct sockaddr_in*)&msg_sa; msg_sin->sin_port = htons(0); memcpy((char*)&(msg_sin->sin_addr), phe->h_addr, phe->h_length); @@ -323,7 +323,7 @@ int main(int argc, char *argv[]) msg.vers = TALK_VERSION; msg.id_num = htonl(0); msg.addr.sa_family = ntohs(AF_INET); - memcpy(&(msg.ctl_addr), &msg_sa, sizeof(struct osockaddr)); + memcpy(&(msg.ctl_addr), &msg_sa, sizeof(struct osockaddr)); /*msg.ctl_addr = *(struct sockaddr*)&ctl_sin; msg.ctl_addr = *(struct sockaddr*)&ctl_sin;*/ msg.ctl_addr.sa_family = ntohs(AF_INET); diff --git a/yamdrv/README.yamdrv b/yamdrv/README.yamdrv index 280a3ce..ada27f2 100644 --- a/yamdrv/README.yamdrv +++ b/yamdrv/README.yamdrv @@ -12,7 +12,7 @@ yam3 default to COM4 0x3e8 irq3 Added : bitrate/baudrate configuration. Added : mcs file may be loaded from yamcfg. - One mcs file is affected to each bitrate. + One mcs file is affected to each bitrate. mcs data for 1200 and 9600 bds are preloaded in the driver but may be changed by yamcfg. |