Skip to content

Commit

Permalink
cmd completed
Browse files Browse the repository at this point in the history
  • Loading branch information
marie-j committed Nov 14, 2015
1 parent cbce1ec commit b6f5996
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
14 changes: 8 additions & 6 deletions cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,16 @@ void do_kill(char **argv) {

/* do_exit - Execute the builtin exit command */
void do_exit() {
printf("do_exit : To be implemented\n");

return;
if (verbose) {
printf("Exiting \n");
}
exit(EXIT_SUCCESS);
}

/* do_jobs - Execute the builtin fg command */
void do_jobs() {
printf("do_jobs : To be implemented\n");

return;
if (verbose) {
printf("Current jobs in the foreground process\n");
}
jobs_listjobs();
}
Binary file modified cmd.o
Binary file not shown.
4 changes: 2 additions & 2 deletions jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int jobs_deletejob(pid_t pid) {
for (i = 0; i < MAXJOBS; i++) {
if (jobs[i].jb_pid == pid) {
jobs_clearjob(&jobs[i]);
nextjid = jobs_maxjid(jobs) + 1;
nextjid = jobs_maxjid() + 1;
return 1;
}
}
Expand Down Expand Up @@ -160,7 +160,7 @@ void jobs_listjobs() {
default:
printf("listjobs: Internal error: job[%d].state=%d ", i, jobs[i].jb_state);
}
printf("%s", jobs[i].jb_cmdline);
printf("%s\n", jobs[i].jb_cmdline);
}
}
}
Binary file modified jobs.o
Binary file not shown.
1 change: 1 addition & 0 deletions pipe.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* mshell - a job manager */

#include <stdio.h>
#include <string.h>
#include "pipe.h"

void do_pipe(char *cmds[MAXCMDS][MAXARGS], int nbcmd, int bg) {
Expand Down
Binary file removed pipe.o
Binary file not shown.
Binary file modified sighandlers.o
Binary file not shown.

0 comments on commit b6f5996

Please sign in to comment.