[hipl-commit] [trunk] Rev 4378: Check the return value of system(2).

  • From: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Wed, 21 Apr 2010 03:59:54 +0300

Committer: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
Date: 21/04/2010 at 03:59:54
Revision: 4378
Revision-id: mircea.gherzan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Check the return value of system(2).

Modified:
  M  hipd/init.c

=== modified file 'hipd/init.c'
--- hipd/init.c 2010-04-20 23:29:00 +0000
+++ hipd/init.c 2010-04-21 00:56:17 +0000
@@ -343,9 +343,10 @@
 
     for (type = 0; type < 2; type++) {
         for (i = 0; i < count[type]; i++) {
-            HIP_DEBUG("Removing %s\n", mods[type][i]);
             snprintf(cmd, sizeof(cmd), "/sbin/modprobe -r %s", mods[type][i]);
-            system(cmd);
+            if (system(cmd)) {
+                HIP_DEBUG("Unable to remove the %s module!\n", mods[type][i]);
+            }
         }
     }
 }

Other related posts:

  • » [hipl-commit] [trunk] Rev 4378: Check the return value of system(2). - Mircea Gherzan