Skip to content

Instantly share code, notes, and snippets.

@raduraducu
Created September 16, 2013 11:11
Show Gist options
  • Select an option

  • Save raduraducu/6579324 to your computer and use it in GitHub Desktop.

Select an option

Save raduraducu/6579324 to your computer and use it in GitHub Desktop.

Revisions

  1. raduraducu created this gist Sep 16, 2013.
    6 changes: 6 additions & 0 deletions new_gist_file
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    char *buf;
    buf = (char *)calloc(1024, sizeof(char));
    fcntl(STDERR_FILENO, F_GETPATH, buf);
    printf("----------------- old log path: %s\n", buf);
    int retValue = dup2(fd, STDERR_FILENO);
    free(buf);