/[baselayout]/trunk/src/runscript.c
Gentoo

Diff of /trunk/src/runscript.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2764 Revision 2765
1190 restarting. */ 1190 restarting. */
1191 unsetenv ("RC_CMD"); 1191 unsetenv ("RC_CMD");
1192 setenv ("RC_CMD", optarg, 1); 1192 setenv ("RC_CMD", optarg, 1);
1193 1193
1194 doneone = true; 1194 doneone = true;
1195
1196 if (strcmp (optarg, "describe") == 0) {
1197 svc_exec (optarg, NULL);
1195 if (strcmp (optarg, "help") == 0) { 1198 } else if (strcmp (optarg, "help") == 0) {
1196 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL); 1199 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL);
1197 eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s", 1200 eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",
1198 applet, strerror (errno)); 1201 applet, strerror (errno));
1199 } else if (strcmp (optarg, "ineed") == 0 || 1202 } else if (strcmp (optarg, "ineed") == 0 ||
1200 strcmp (optarg, "iuse") == 0 || 1203 strcmp (optarg, "iuse") == 0 ||
1216 printf ("%s%s", i == 1 ? "" : " ", svc); 1219 printf ("%s%s", i == 1 ? "" : " ", svc);
1217 printf ("\n"); 1220 printf ("\n");
1218 } else if (strcmp (optarg, "status") == 0) { 1221 } else if (strcmp (optarg, "status") == 0) {
1219 rc_service_state_t r = svc_status (service); 1222 rc_service_state_t r = svc_status (service);
1220 retval = (int) r; 1223 retval = (int) r;
1224
1221 } else if (strcmp (optarg, "help") == 0) { 1225 } else if (strcmp (optarg, "help") == 0) {
1222 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL); 1226 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL);
1223 eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s", 1227 eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",
1224 applet, strerror (errno)); 1228 applet, strerror (errno));
1225 } else { 1229 } else {
1256 } 1260 }
1257 } else if (strcmp (optarg, "zap") == 0) { 1261 } else if (strcmp (optarg, "zap") == 0) {
1258 einfo ("Manually resetting %s to stopped state", applet); 1262 einfo ("Manually resetting %s to stopped state", applet);
1259 rc_mark_service (applet, rc_service_stopped); 1263 rc_mark_service (applet, rc_service_stopped);
1260 uncoldplug (); 1264 uncoldplug ();
1261 }else 1265 } else
1262 svc_exec (optarg, NULL); 1266 svc_exec (optarg, NULL);
1263 1267
1264 /* Flush our buffered output if any */ 1268 /* Flush our buffered output if any */
1265 eflush (); 1269 eflush ();
1266 1270

Legend:
Removed from v.2764  
changed lines
  Added in v.2765

  ViewVC Help
Powered by ViewVC 1.1.20