My code should be replacing the initial signal handler with the function handler(), but this isn't happening
// function for signal handling
int handler(int signum) {
  fprintf(stdout, "Bruh Moment");
  exit(0);
}


/* The first command-line argument is the number of seconds to set a timer to run.
 * The second argument is the name of a binary file containing 100 ints.
 * Assume both of these arguments are correct.
 */

int main(int argc, char **argv) {
    if (argc != 3) {
        fprintf(stderr, "Usage: time_reads s filename\n");
        exit(1);
    }
    seconds = strtol(argv[1], NULL, 10);

    FILE *fp;
    if ((fp = fopen(argv[2], "r")) == NULL) {
      perror("fopen");
      exit(1);
    }

    int max = 99;
    int min = 0;

    // create a struct sigaction
    struct sigaction act;
    act.sa_handler = (__sighandler_t) handler;
    if (sigaction(SIGINT, &act, NULL) == -1) {
      perror("sigaction");
      exit(1);
    }

    /* In an infinite loop, read an int from a random location in the file,
     * and print it to stderr.
     */
    for (;;) {
      int index = random() % (max - min + 1) + min;

      if (fseek(fp, index * sizeof(int), SEEK_SET) == -1) {
        perror("fseek");
        exit(1);
      }

      int k;
      if (fread(&k, sizeof(int), 1, fp) == -1) {
        perror("fread");
        exit(1);
      }

      printf("%d", k);

    }
    return 1; // something is wrong if we ever get here!
}