Why is this code not compiling?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

#define MAXLINE 256

#define SUCCESS "Password verified\n"
#define INVALID "Invalid password\n"
#define NO_USER "No such user\n"

int main(void) {
  char user_id[MAXLINE];
  char password[MAXLINE];
  int status;

  /* The user will type in a user name on one line followed by a password 
     on the next.
     DO NOT add any prompts.  The only output of this program will be one 
	 of the messages defined above.
     Please read the comments in validate carefully
   */

  if(fgets(user_id, MAXLINE, stdin) == NULL) {
      perror("fgets");
      exit(1);
  }
  if(fgets(password, MAXLINE, stdin) == NULL) {
      perror("fgets");
      exit(1);
  }
  
  // TODO

  // check length

  // create pipe
  int fd[2];
  if (pipe(fd) == -1) {
      perror("pipe");
      exit(1);
  }

  // fork

  int result = fork();
  if (result < 0) {
      perror("fork");
      exit(1);
  }

  // if child execl, close write, use dup2 to change stdin to read end of pipe
  if (result == 0) {
      // dup2 
      if (close(fd[1]) != 0) {
        perror("pipe");
        exit(1);
      }
  } else {
      if (close(fd[0]) != 0) {
        perror("pipe");
        exit(1);
      }
  }

  // if parent wait
  wait(&status);

  if (WIFEXITED(status)) {
      int s = WEXITSTATUS(status);
      if (s == 0) {
          printf(SUCCESS);
      } elif (s == 2) {
          printf(INVALID);
      } elif (s == 3) {
          printf(NO_USER);
      }
  }

  return 0;
}
