Change list_elem from typedef to struct.
[pintos-anon] / solutions / p2.patch
index 1de7f57166997b328d144103fc38c95349532a8b..add0f5ac52989cd0a9277f21dc73bc2614334971 100644 (file)
@@ -111,7 +111,7 @@ diff -u -p -r1.48 thread.c
  thread_exit (void) 
  {
 +  struct thread *t = thread_current ();
-+  list_elem *e, *next;
++  struct list_elem *e, *next;
 +
    ASSERT (!intr_context ());
  
@@ -154,7 +154,7 @@ diff -u -p -r1.48 thread.c
 +thread_join (tid_t child_tid) 
 +{
 +  struct thread *cur = thread_current ();
-+  list_elem *e;
++  struct list_elem *e;
 +
 +  for (e = list_begin (&cur->children); e != list_end (&cur->children); ) 
 +    {
@@ -206,11 +206,11 @@ diff -u -p -r1.28 thread.h
 +    struct latch ready_to_die;          /* Release when thread about to die. */
 +    struct semaphore can_die;           /* Up when thread allowed to die. */
 +    struct list children;               /* List of child threads. */
-+    list_elem children_elem;            /* Element of `children' list. */
++    struct list_elem children_elem;     /* Element of `children' list. */
 +    int exit_code;                      /* Return status. */
 +
      /* Shared between thread.c and synch.c. */
-     list_elem elem;                     /* List element. */
+     struct list_elem elem;              /* List element. */
  
  #ifdef USERPROG
      /* Owned by userprog/process.c. */
@@ -759,9 +759,9 @@ diff -u -p -r1.4 syscall.c
 +/* A file descriptor, for binding a file handle to a file. */
 +struct file_descriptor
 +  {
-+    list_elem elem;     /* List element. */
-+    struct file *file;  /* File. */
-+    int handle;         /* File handle. */
++    struct list_elem elem;      /* List element. */
++    struct file *file;          /* File. */
++    int handle;                 /* File handle. */
 +  };
 + 
 +/* Open system call. */
@@ -799,7 +799,7 @@ diff -u -p -r1.4 syscall.c
 +lookup_fd (int handle) 
 +{
 +  struct thread *cur = thread_current ();
-+  list_elem *e;
++  struct list_elem *e;
 +   
 +  for (e = list_begin (&cur->fds); e != list_end (&cur->fds);
 +       e = list_next (e))
@@ -985,7 +985,7 @@ diff -u -p -r1.4 syscall.c
 +syscall_exit (void) 
 +{
 +  struct thread *cur = thread_current ();
-+  list_elem *e, *next;
++  struct list_elem *e, *next;
 +   
 +  for (e = list_begin (&cur->fds); e != list_end (&cur->fds); e = next)
 +    {