Permalink
Browse files

updates

  • Loading branch information...
1 parent 357b0f3 commit df3717218217bacac667988231c2e0ae34394c44 @Frankencelery Frankencelery committed Nov 2, 2012
Showing with 12 additions and 5 deletions.
  1. +1 −1 src/threads/thread.c
  2. +2 −3 src/userprog/process.c
  3. +9 −1 src/userprog/syscall.c
View
@@ -293,7 +293,7 @@ thread_exit (void)
if (!sema_try_down(&thread_current ()->wait_status->dead)){
printf("Error! (%s) has not been given permission to die.\n",thread_current ()->name);
}
- sema_up(&thread_current ()->wait_status->dead); //Do this for make check if not everything implemented.
+ //sema_up(&thread_current ()->wait_status->dead); //Do this for make check if not everything implemented.
#ifdef USERPROG
process_exit ();
#endif
View
@@ -157,21 +157,20 @@ process_wait (tid_t child_tid)
void
process_exit (void)
{
- //printf(" "); Having this line causes exit code to print??? Not having it does not.
+ //printf(" "); //Having this line causes exit code to print??? Not having it does not.
struct thread *cur = thread_current ();
struct list_elem *e, *next;
uint32_t *pd;
/* Close executable (and allow writes). */
file_close (cur->bin_file);
-
/* Notify parent that we're dead. */
if (cur->wait_status != NULL)
{
/* add code */
struct wait_status *cs = cur->wait_status;
sema_up(&cur->wait_status->dead);
- printf ("%s: exit(%d)\n", cur->name,cur->wait_status->exit_code); // HACK all successful ;-)
+ printf ("%s: exit(%d)\n", cur->name,cur->wait_status->exit_code);
release_child (cs);
}
View
@@ -185,6 +185,7 @@ static int
sys_exit (int exit_code)
{
thread_current ()->wait_status->exit_code = exit_code;
+ //printf("wait_status->exit_code = %d\n", thread_current ()->wait_status->exit_code);
sema_up(&(thread_current ()->wait_status->dead));
thread_exit ();
NOT_REACHED ();
@@ -211,8 +212,15 @@ static int
sys_create (const char *ufile, unsigned initial_size)
{
bool sucess = false;
- if(ufile==NULL){return(-1);}//This presently does not work...
+ if(ufile==NULL)
+ {
+ //close the program
+ sys_exit(-1);
+ NOT_REACHED ();
+ }
+ printf("attempting copy\n");
char *kfile = copy_in_string(ufile);
+ printf("copy worked!\n");
lock_acquire (&fs_lock);
if (kfile != NULL)
{

0 comments on commit df37172

Please sign in to comment.