diff --git a/src/Pish.c b/src/Pish.c index 26bcf70..34fce97 100644 --- a/src/Pish.c +++ b/src/Pish.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -27,6 +28,9 @@ void Pish(void) CommandStruct* commandChild = &commandChildObject; char inputString[1000]; // Max 1000 characters int forkPID; + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGTERM, SIG_IGN); ReadPishrc(commandParent, commandChild, inputString); while (1) { @@ -60,7 +64,7 @@ void ReadPishrc(CommandStruct *commandParent, CommandStruct *commandChild, char int *argc = &(commandParent->argc); char* pishLocation = GetHomeDir(); strcat(pishLocation, "/.pishrc"); - int fd = open(pishLocation, O_RDONLY | O_CREAT); + int fd = open(pishLocation, O_RDONLY | O_CREAT, 0644); assert(fd > -1); while (read(fd, buffer, 1) > 0) {