Author: heer Date: Thu Oct 22 12:45:43 2009 New Revision: 1274 Log: Removed warnings resulting from unhandled return value from pisawqbeacon Modified: trunk/pisabeacon/beaconmain.c Modified: trunk/pisabeacon/beaconmain.c ============================================================================== --- trunk/pisabeacon/beaconmain.c Thu Oct 22 12:43:24 2009 (r1273) +++ trunk/pisabeacon/beaconmain.c Thu Oct 22 12:45:43 2009 (r1274) @@ -113,7 +113,9 @@ /* addr and port are already set by init */ ctx.bc_addr.sin_family = AF_INET; - + + /* error code for system call */ + int err; if (ctx.mode == PLB_SENDER) { /* Sender mode: send broadcasts */ @@ -156,7 +158,10 @@ ctx.bc_addr.sin_addr.s_addr = htonl(INADDR_ANY); - bind(ctx.bc_fd, (struct sockaddr *) &ctx.bc_addr, sizeof(ctx.bc_addr)); + if(bind(ctx.bc_fd, (struct sockaddr *) &ctx.bc_addr, sizeof(ctx.bc_addr)) != 0){ + perror("Cannot bind to specified IP address range\n"); + exit(EXIT_FAILURE); + } printf("Waiting for geo location id on port %d\n", ntohs(ctx.bc_addr.sin_port)); @@ -174,7 +179,9 @@ /* run the specified script */ if (ctx.run_script[0] != 0) { sprintf(script_buffer, "%s %d", ctx.run_script, last_geo_id); - system(script_buffer); + if(system(script_buffer) != 0){ + printf("Script '%s' returned error.\n", script_buffer); + } } else { printf("New geo ID: %d\n", last_geo_id); }