style fixes. No code changes.

This commit is contained in:
Denis Vlasenko 2007-04-10 15:42:06 +00:00
parent 163516da3a
commit ff131b980d
13 changed files with 30 additions and 31 deletions

View File

@ -70,15 +70,15 @@
/* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'. /* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'.
So the default is to disable 'swtch.' */ So the default is to disable 'swtch.' */
#if defined (__sparc__) && defined (__svr4__) #if defined(__sparc__) && defined(__svr4__)
# undef CSWTCH # undef CSWTCH
# define CSWTCH _POSIX_VDISABLE # define CSWTCH _POSIX_VDISABLE
#endif #endif
#if defined(VWERSE) && !defined (VWERASE) /* AIX-3.2.5 */ #if defined(VWERSE) && !defined(VWERASE) /* AIX-3.2.5 */
# define VWERASE VWERSE # define VWERASE VWERSE
#endif #endif
#if defined(VDSUSP) && !defined (CDSUSP) #if defined(VDSUSP) && !defined(CDSUSP)
# define CDSUSP Control('y') # define CDSUSP Control('y')
#endif #endif
#if !defined(VREPRINT) && defined(VRPRNT) /* Irix 4.0.5 */ #if !defined(VREPRINT) && defined(VRPRNT) /* Irix 4.0.5 */

View File

@ -55,7 +55,7 @@
#include "ext2_fs.h" #include "ext2_fs.h"
#include "ext2fs.h" #include "ext2fs.h"
#if defined(__CYGWIN__) || defined (WIN32) #if defined(__CYGWIN__) || defined(WIN32)
#include <windows.h> #include <windows.h>
#include <winioctl.h> #include <winioctl.h>

View File

@ -445,7 +445,7 @@ getopt32(int argc, char **argv, const char *applet_opts, ...)
} }
s--; s--;
} }
va_end (p); va_end(p);
if (spec_flgs & FIRST_ARGV_IS_OPT) { if (spec_flgs & FIRST_ARGV_IS_OPT) {
if (argv[1] && argv[1][0] != '-' && argv[1][0] != '\0') { if (argv[1] && argv[1][0] != '-' && argv[1][0] != '\0') {

View File

@ -280,7 +280,7 @@ extern int insmod_ng_main( int argc, char **argv);
#endif #endif
/* v850e */ /* v850e */
#if defined (__v850e__) #if defined(__v850e__)
#define MATCH_MACHINE(x) ((x) == EM_V850 || (x) == EM_CYGNUS_V850) #define MATCH_MACHINE(x) ((x) == EM_V850 || (x) == EM_CYGNUS_V850)
#define SHT_RELM SHT_RELA #define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela #define Elf32_RelM Elf32_Rela
@ -982,7 +982,7 @@ arch_apply_relocation(struct obj_file *f,
*loc += v - got; *loc += v - got;
break; break;
#elif defined (__microblaze__) #elif defined(__microblaze__)
case R_MICROBLAZE_NONE: case R_MICROBLAZE_NONE:
case R_MICROBLAZE_64_NONE: case R_MICROBLAZE_64_NONE:
case R_MICROBLAZE_32_SYM_OP_SYM: case R_MICROBLAZE_32_SYM_OP_SYM:
@ -1540,7 +1540,7 @@ arch_apply_relocation(struct obj_file *f,
} }
# endif /* __SH5__ */ # endif /* __SH5__ */
#elif defined (__v850e__) #elif defined(__v850e__)
case R_V850_NONE: case R_V850_NONE:
break; break;
@ -1663,7 +1663,7 @@ bb_use_plt:
ip[2] = 0x7d6903a6; /* mtctr r11 */ ip[2] = 0x7d6903a6; /* mtctr r11 */
ip[3] = 0x4e800420; /* bctr */ ip[3] = 0x4e800420; /* bctr */
#endif #endif
#if defined (__v850e__) #if defined(__v850e__)
/* We have to trash a register, so we assume that any control /* We have to trash a register, so we assume that any control
transfer more than 21-bits away must be a function call transfer more than 21-bits away must be a function call
(so we can use a call-clobbered register). */ (so we can use a call-clobbered register). */
@ -1676,15 +1676,15 @@ bb_use_plt:
/* relative distance to target */ /* relative distance to target */
v -= dot; v -= dot;
/* if the target is too far away.... */ /* if the target is too far away.... */
#if defined (__arm__) || defined (__powerpc__) #if defined(__arm__) || defined(__powerpc__)
if ((int)v < -0x02000000 || (int)v >= 0x02000000) if ((int)v < -0x02000000 || (int)v >= 0x02000000)
#elif defined (__v850e__) #elif defined(__v850e__)
if ((ElfW(Sword))v > 0x1fffff || (ElfW(Sword))v < (ElfW(Sword))-0x200000) if ((ElfW(Sword))v > 0x1fffff || (ElfW(Sword))v < (ElfW(Sword))-0x200000)
#endif #endif
/* go via the plt */ /* go via the plt */
v = plt + pe->offset - dot; v = plt + pe->offset - dot;
#if defined (__v850e__) #if defined(__v850e__)
if (v & 1) if (v & 1)
#else #else
if (v & 3) if (v & 3)
@ -1701,7 +1701,7 @@ bb_use_plt:
#if defined(__powerpc__) #if defined(__powerpc__)
*loc = (*loc & ~0x03fffffc) | (v & 0x03fffffc); *loc = (*loc & ~0x03fffffc) | (v & 0x03fffffc);
#endif #endif
#if defined (__v850e__) #if defined(__v850e__)
/* We write two shorts instead of a long because even 32-bit insns /* We write two shorts instead of a long because even 32-bit insns
only need half-word alignment, but the 32-bit data write needs only need half-word alignment, but the 32-bit data write needs
to be long-word aligned. */ to be long-word aligned. */
@ -1895,7 +1895,7 @@ static void arch_create_got(struct obj_file *f)
got_needed = 1; got_needed = 1;
continue; continue;
#elif defined (__v850e__) #elif defined(__v850e__)
case R_V850_22_PCREL: case R_V850_22_PCREL:
plt_needed = 1; plt_needed = 1;
break; break;

View File

@ -686,8 +686,8 @@ static int check_pattern(const char* pat_src, const char* mod_src) {
ret = fnmatch(pat, mod, 0); ret = fnmatch(pat, mod, 0);
if (ENABLE_FEATURE_CLEAN_UP) { if (ENABLE_FEATURE_CLEAN_UP) {
free (pat); free(pat);
free (mod); free(mod);
} }
return ret; return ret;

View File

@ -49,7 +49,7 @@
#define RTF_REJECT 0x0200 /* Reject route */ #define RTF_REJECT 0x0200 /* Reject route */
#endif #endif
#if defined (SIOCADDRTOLD) || defined (RTF_IRTT) /* route */ #if defined(SIOCADDRTOLD) || defined(RTF_IRTT) /* route */
#define HAVE_NEW_ADDRT 1 #define HAVE_NEW_ADDRT 1
#endif #endif

View File

@ -285,8 +285,6 @@ make_new_session(
/* make new process group */ /* make new process group */
setsid(); setsid();
tcsetpgrp(0, getpid());
/* ^^^ strace says: "ioctl(0, TIOCSPGRP, [pid]) = -1 ENOTTY" -- ??! */
/* open the child's side of the tty. */ /* open the child's side of the tty. */
/* NB: setsid() disconnects from any previous ctty's. Therefore /* NB: setsid() disconnects from any previous ctty's. Therefore
@ -296,6 +294,7 @@ make_new_session(
dup2(fd, 1); dup2(fd, 1);
dup2(fd, 2); dup2(fd, 2);
while (fd > 2) close(fd--); while (fd > 2) close(fd--);
tcsetpgrp(0, getpid()); /* comment? */
/* The pseudo-terminal allocated to the client is configured to operate in /* The pseudo-terminal allocated to the client is configured to operate in
* cooked mode, and with XTABS CRMOD enabled (see tty(4)). */ * cooked mode, and with XTABS CRMOD enabled (see tty(4)). */

View File

@ -303,7 +303,8 @@ static void startservice(struct svdir *s)
} }
run[1] = NULL; run[1] = NULL;
if (s->pid != 0) stopservice(s); /* should never happen */ if (s->pid != 0)
stopservice(s); /* should never happen */
while ((p = fork()) == -1) { while ((p = fork()) == -1) {
warn_cannot("fork, sleeping"); warn_cannot("fork, sleeping");
sleep(5); sleep(5);

View File

@ -110,7 +110,7 @@ int runcon_main(int argc, char **argv)
if (!(opts & OPTS_CONTEXT_COMPONENT)) { if (!(opts & OPTS_CONTEXT_COMPONENT)) {
context = *argv++; context = *argv++;
if (!argv[0]) if (!argv[0])
bb_error_msg_and_die("no command found"); bb_error_msg_and_die("no command given");
} }
if (context) { if (context) {
@ -133,5 +133,4 @@ int runcon_main(int argc, char **argv)
execvp(argv[0], argv); execvp(argv[0], argv);
bb_perror_msg_and_die("cannot execute '%s'", argv[0]); bb_perror_msg_and_die("cannot execute '%s'", argv[0]);
return 1;
} }

View File

@ -2044,7 +2044,7 @@ static int reserved_word(o_string *dest, struct p_context *ctx)
*ctx = *old; /* physical copy */ *ctx = *old; /* physical copy */
free(old); free(old);
} }
b_reset (dest); b_reset(dest);
return 1; return 1;
} }
} }
@ -2666,7 +2666,7 @@ static void setup_job_control(void)
static pid_t shell_pgrp; static pid_t shell_pgrp;
/* Loop until we are in the foreground. */ /* Loop until we are in the foreground. */
while (tcgetpgrp (shell_terminal) != (shell_pgrp = getpgrp ())) while (tcgetpgrp (shell_terminal) != (shell_pgrp = getpgrp ()))
kill (- shell_pgrp, SIGTTIN); kill(- shell_pgrp, SIGTTIN);
/* Ignore interactive and job-control signals. */ /* Ignore interactive and job-control signals. */
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);

View File

@ -582,7 +582,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
if (openfd != redir->fd) { if (openfd != redir->fd) {
if (squirrel && redir->fd < 3) { if (squirrel && redir->fd < 3) {
squirrel[redir->fd] = dup(redir->fd); squirrel[redir->fd] = dup(redir->fd);
fcntl (squirrel[redir->fd], F_SETFD, FD_CLOEXEC); fcntl(squirrel[redir->fd], F_SETFD, FD_CLOEXEC);
} }
dup2(openfd, redir->fd); dup2(openfd, redir->fd);
close(openfd); close(openfd);
@ -763,7 +763,7 @@ static int expand_arguments(char *command)
free(tmpcmd); /* Free mem allocated by strsep_space */ free(tmpcmd); /* Free mem allocated by strsep_space */
if (retval == GLOB_NOSPACE) { if (retval == GLOB_NOSPACE) {
/* Mem may have been allocated... */ /* Mem may have been allocated... */
globfree (&expand_result); globfree(&expand_result);
bb_error_msg(out_of_space); bb_error_msg(out_of_space);
return FALSE; return FALSE;
} else if (retval != 0) { } else if (retval != 0) {
@ -786,7 +786,7 @@ static int expand_arguments(char *command)
strcat(command+total_length, expand_result.gl_pathv[i]); strcat(command+total_length, expand_result.gl_pathv[i]);
total_length += length; total_length += length;
} }
globfree (&expand_result); globfree(&expand_result);
} }
} }
free(cmd_copy); free(cmd_copy);
@ -1478,7 +1478,7 @@ static void setup_job_control(void)
if (status == (shell_pgrp = getpgrp ())) { if (status == (shell_pgrp = getpgrp ())) {
break; break;
} }
kill (- shell_pgrp, SIGTTIN); kill(- shell_pgrp, SIGTTIN);
} }
/* Ignore interactive and job-control signals. */ /* Ignore interactive and job-control signals. */

View File

@ -17,7 +17,7 @@
#include <sys/msg.h> #include <sys/msg.h>
#include <sys/sem.h> #include <sys/sem.h>
#if defined (__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
/* union semun is defined by including <sys/sem.h> */ /* union semun is defined by including <sys/sem.h> */
#else #else
/* according to X/OPEN we have to define it ourselves */ /* according to X/OPEN we have to define it ourselves */

View File

@ -67,7 +67,7 @@ struct shm_info {
/* The last arg of semctl is a union semun, but where is it defined? /* The last arg of semctl is a union semun, but where is it defined?
X/OPEN tells us to define it ourselves, but until recently X/OPEN tells us to define it ourselves, but until recently
Linux include files would also define it. */ Linux include files would also define it. */
#if defined (__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
/* union semun is defined by including <sys/sem.h> */ /* union semun is defined by including <sys/sem.h> */
#else #else
/* according to X/OPEN we have to define it ourselves */ /* according to X/OPEN we have to define it ourselves */
@ -84,7 +84,7 @@ union semun {
<linux/ipc.h>, which defines a struct ipc_perm with such fields. <linux/ipc.h>, which defines a struct ipc_perm with such fields.
glibc-1.09 has no support for sysv ipc. glibc-1.09 has no support for sysv ipc.
glibc 2 uses __key, __seq */ glibc 2 uses __key, __seq */
#if defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 #if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#define KEY __key #define KEY __key
#else #else
#define KEY key #define KEY key