summaryrefslogtreecommitdiffstats
path: root/rfcomm/main.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-11-10 23:18:53 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-11-10 23:18:53 +0000
commitcd3839f1d911767db77d1383e2ac1b1df405bed2 (patch)
tree7718b2326c667363668df23cf7ca2abcbd538aae /rfcomm/main.c
parentf64cc95873c872ad5a34abe6418a2e26570d5d02 (diff)
Cleanup of rfcomm exec command patch
Diffstat (limited to 'rfcomm/main.c')
-rw-r--r--rfcomm/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/rfcomm/main.c b/rfcomm/main.c
index efffcc9a..7e42b910 100644
--- a/rfcomm/main.c
+++ b/rfcomm/main.c
@@ -261,10 +261,8 @@ static int release_all(int ctl)
static void run_cmdline(struct pollfd *p, sigset_t* sigs, char *devname,
int argc, char **argv)
{
- int i = 0;
- pid_t pid, child;
- struct timespec ts;
- int status = 0;
+ int i;
+ pid_t pid;
char **cmdargv;
cmdargv = malloc((argc + 1) * sizeof(char*));
@@ -289,6 +287,10 @@ static void run_cmdline(struct pollfd *p, sigset_t* sigs, char *devname,
break;
default:
while (1) {
+ int status;
+ pid_t child;
+ struct timespec ts;
+
child = waitpid(-1, &status, WNOHANG);
if (child == pid || (child < 0 && errno != EAGAIN))
break;