/* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'.
So the default is to disable 'swtch.' */
-#if defined (__sparc__) && defined (__svr4__)
+#if defined(__sparc__) && defined(__svr4__)
# undef CSWTCH
# define CSWTCH _POSIX_VDISABLE
#endif
-#if defined(VWERSE) && !defined (VWERASE) /* AIX-3.2.5 */
+#if defined(VWERSE) && !defined(VWERASE) /* AIX-3.2.5 */
# define VWERASE VWERSE
#endif
-#if defined(VDSUSP) && !defined (CDSUSP)
+#if defined(VDSUSP) && !defined(CDSUSP)
# define CDSUSP Control('y')
#endif
#if !defined(VREPRINT) && defined(VRPRNT) /* Irix 4.0.5 */
#include "ext2_fs.h"
#include "ext2fs.h"
-#if defined(__CYGWIN__) || defined (WIN32)
+#if defined(__CYGWIN__) || defined(WIN32)
#include <windows.h>
#include <winioctl.h>
}
s--;
}
- va_end (p);
+ va_end(p);
if (spec_flgs & FIRST_ARGV_IS_OPT) {
if (argv[1] && argv[1][0] != '-' && argv[1][0] != '\0') {
#endif
/* v850e */
-#if defined (__v850e__)
+#if defined(__v850e__)
#define MATCH_MACHINE(x) ((x) == EM_V850 || (x) == EM_CYGNUS_V850)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
*loc += v - got;
break;
-#elif defined (__microblaze__)
+#elif defined(__microblaze__)
case R_MICROBLAZE_NONE:
case R_MICROBLAZE_64_NONE:
case R_MICROBLAZE_32_SYM_OP_SYM:
}
# endif /* __SH5__ */
-#elif defined (__v850e__)
+#elif defined(__v850e__)
case R_V850_NONE:
break;
ip[2] = 0x7d6903a6; /* mtctr r11 */
ip[3] = 0x4e800420; /* bctr */
#endif
-#if defined (__v850e__)
+#if defined(__v850e__)
/* We have to trash a register, so we assume that any control
transfer more than 21-bits away must be a function call
(so we can use a call-clobbered register). */
/* relative distance to target */
v -= dot;
/* if the target is too far away.... */
-#if defined (__arm__) || defined (__powerpc__)
+#if defined(__arm__) || defined(__powerpc__)
if ((int)v < -0x02000000 || (int)v >= 0x02000000)
-#elif defined (__v850e__)
+#elif defined(__v850e__)
if ((ElfW(Sword))v > 0x1fffff || (ElfW(Sword))v < (ElfW(Sword))-0x200000)
#endif
/* go via the plt */
v = plt + pe->offset - dot;
-#if defined (__v850e__)
+#if defined(__v850e__)
if (v & 1)
#else
if (v & 3)
#if defined(__powerpc__)
*loc = (*loc & ~0x03fffffc) | (v & 0x03fffffc);
#endif
-#if defined (__v850e__)
+#if defined(__v850e__)
/* 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
to be long-word aligned. */
got_needed = 1;
continue;
-#elif defined (__v850e__)
+#elif defined(__v850e__)
case R_V850_22_PCREL:
plt_needed = 1;
break;
ret = fnmatch(pat, mod, 0);
if (ENABLE_FEATURE_CLEAN_UP) {
- free (pat);
- free (mod);
+ free(pat);
+ free(mod);
}
return ret;
#define RTF_REJECT 0x0200 /* Reject route */
#endif
-#if defined (SIOCADDRTOLD) || defined (RTF_IRTT) /* route */
+#if defined(SIOCADDRTOLD) || defined(RTF_IRTT) /* route */
#define HAVE_NEW_ADDRT 1
#endif
/* make new process group */
setsid();
- tcsetpgrp(0, getpid());
- /* ^^^ strace says: "ioctl(0, TIOCSPGRP, [pid]) = -1 ENOTTY" -- ??! */
/* open the child's side of the tty. */
/* NB: setsid() disconnects from any previous ctty's. Therefore
dup2(fd, 1);
dup2(fd, 2);
while (fd > 2) close(fd--);
+ tcsetpgrp(0, getpid()); /* comment? */
/* The pseudo-terminal allocated to the client is configured to operate in
* cooked mode, and with XTABS CRMOD enabled (see tty(4)). */
}
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) {
warn_cannot("fork, sleeping");
sleep(5);
if (!(opts & OPTS_CONTEXT_COMPONENT)) {
context = *argv++;
if (!argv[0])
- bb_error_msg_and_die("no command found");
+ bb_error_msg_and_die("no command given");
}
if (context) {
execvp(argv[0], argv);
bb_perror_msg_and_die("cannot execute '%s'", argv[0]);
- return 1;
}
*ctx = *old; /* physical copy */
free(old);
}
- b_reset (dest);
+ b_reset(dest);
return 1;
}
}
static pid_t shell_pgrp;
/* Loop until we are in the foreground. */
while (tcgetpgrp (shell_terminal) != (shell_pgrp = getpgrp ()))
- kill (- shell_pgrp, SIGTTIN);
+ kill(- shell_pgrp, SIGTTIN);
/* Ignore interactive and job-control signals. */
signal(SIGINT, SIG_IGN);
if (openfd != redir->fd) {
if (squirrel && redir->fd < 3) {
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);
close(openfd);
free(tmpcmd); /* Free mem allocated by strsep_space */
if (retval == GLOB_NOSPACE) {
/* Mem may have been allocated... */
- globfree (&expand_result);
+ globfree(&expand_result);
bb_error_msg(out_of_space);
return FALSE;
} else if (retval != 0) {
strcat(command+total_length, expand_result.gl_pathv[i]);
total_length += length;
}
- globfree (&expand_result);
+ globfree(&expand_result);
}
}
free(cmd_copy);
if (status == (shell_pgrp = getpgrp ())) {
break;
}
- kill (- shell_pgrp, SIGTTIN);
+ kill(- shell_pgrp, SIGTTIN);
}
/* Ignore interactive and job-control signals. */
#include <sys/msg.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> */
#else
/* according to X/OPEN we have to define it ourselves */
/* 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
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> */
#else
/* according to X/OPEN we have to define it ourselves */
<linux/ipc.h>, which defines a struct ipc_perm with such fields.
glibc-1.09 has no support for sysv ipc.
glibc 2 uses __key, __seq */
-#if defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
+#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#define KEY __key
#else
#define KEY key