title: Why isn't chdir() working?
body: <p>When I try to run ./shell cd includes/ 
  I don't actually change into the includes directory. Here's my code:</p>
  
  <pre><code>int cd(char *path) {
          printf("i got there at least\n");
          if(path  == NULL) {
                  printf("dont waork\n");
                  print_usage();
          } else {
  
                  printf("print please\n");
                  int dir_change = chdir(path);
                  if(dir_change != 0)
                          print_no_directory(path);
  
          }
          return 1;
  }
  
  
  int shell(int argc, char *argv[]) {
  
          pid_t pid;
          int status;
  
          pid = fork();
          if(pid == 0) {
                  execl("cd", argv[0], argv[1], argv[2], (char*)NULL);
                  printf("argv[1]: %s\n", argv[1]);
                  if(!strcmp(argv[1], "cd")) {
                          cd(argv[2]);
                  }
          } else if(pid &gt; 0) {
                  waitpid(pid, &amp;status, WUNTRACED);
          } else {
                  print_fork_failed();
          }
          return 0;
  }
  </code></pre>
  
  <p>I don't see what's wrong with my code.</p>