Skip to content

Instantly share code, notes, and snippets.

@rentalcustard
Created October 25, 2010 11:20
Show Gist options
  • Save rentalcustard/644805 to your computer and use it in GitHub Desktop.
Save rentalcustard/644805 to your computer and use it in GitHub Desktop.

Revisions

  1. Tom Stuart revised this gist Nov 29, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 01_readme.markdown
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    The author of this patch is 'toby' from the MacPorts project, and the original commit containing this diff can be found at (https://trac.macports.org/changeset/58563). The trac ticket prompting the commit (and with additional context) is at (https://trac.macports.org/ticket/18357).
    The author of this patch is 'toby' from the MacPorts project, and the original commit containing this diff can be found at [https://trac.macports.org/changeset/58563](https://trac.macports.org/changeset/58563). The trac ticket prompting the commit (and with additional context) is at [https://trac.macports.org/ticket/18357](https://trac.macports.org/ticket/18357).

    Toby, if you're reading this, apologies for not attributing the gist originally; I put this up quickly while experimenting with tmux under Leopard and abandoned it when it didn't solve the problem at hand. It's only fair now that other people are looking at the gist to give you credit.
  2. Tom Stuart revised this gist Nov 29, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 01_readme.markdown
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    The author of this patch is 'toby' from the MacPorts project, and the original commit containing this diff can be found at [https://trac.macports.org/changeset/58563]. The trac ticket prompting the commit (and with additional context) is at [https://trac.macports.org/ticket/18357].
    The author of this patch is 'toby' from the MacPorts project, and the original commit containing this diff can be found at (https://trac.macports.org/changeset/58563). The trac ticket prompting the commit (and with additional context) is at (https://trac.macports.org/ticket/18357).

    Toby, if you're reading this, apologies for not attributing the gist originally; I put this up quickly while experimenting with tmux under Leopard and abandoned it when it didn't solve the problem at hand. It's only fair now that other people are looking at the gist to give you credit.
  3. Tom Stuart renamed this gist Nov 29, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. Tom Stuart revised this gist Nov 29, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 01_readme.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    The author of this patch is 'toby' from the MacPorts project, and the original commit containing this diff can be found at [https://trac.macports.org/changeset/58563]. The trac ticket prompting the commit (and with additional context) is at [https://trac.macports.org/ticket/18357].

    Updated gist with original author details and link to relevant MacPorts trac ticket for context. I'm glad this is useful, but I want neither the credit nor the blame! Toby, if you're reading this, apologies for not attributing the gist originally; I put this up quickly while experimenting with tmux under Leopard and abandoned it when it didn't solve the problem at hand. It's only fair now that other people are looking at the gist to give you credit.
    Toby, if you're reading this, apologies for not attributing the gist originally; I put this up quickly while experimenting with tmux under Leopard and abandoned it when it didn't solve the problem at hand. It's only fair now that other people are looking at the gist to give you credit.
  5. Tom Stuart revised this gist Nov 29, 2010. 2 changed files with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions 01_readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    The author of this patch is 'toby' from the MacPorts project, and the original commit containing this diff can be found at [https://trac.macports.org/changeset/58563]. The trac ticket prompting the commit (and with additional context) is at [https://trac.macports.org/ticket/18357].

    Updated gist with original author details and link to relevant MacPorts trac ticket for context. I'm glad this is useful, but I want neither the credit nor the blame! Toby, if you're reading this, apologies for not attributing the gist originally; I put this up quickly while experimenting with tmux under Leopard and abandoned it when it didn't solve the problem at hand. It's only fair now that other people are looking at the gist to give you credit.
    File renamed without changes.
  6. mortice renamed this gist Nov 1, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. mortice renamed this gist Nov 1, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion server.c.diff → 658103
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,4 @@
    + fatalx("_vprocmgr_detach_from_console failed");

    logfile("server");
    log_debug("server started, pid %ld", (long) getpid());
    log_debug("server started, pid %ld", (long) getpid());
  8. mortice renamed this gist Oct 25, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. mortice created this gist Oct 25, 2010.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    --- server.c.orig 2009-09-20 11:11:24.000000000 -0700
    +++ server.c 2009-09-30 23:20:05.000000000 -0700
    @@ -34,6 +34,8 @@
    #include <time.h>
    #include <unistd.h>

    +void *_vprocmgr_detach_from_console(unsigned int flags);
    +
    #include "tmux.h"

    /*
    @@ -146,8 +148,8 @@
    * Must daemonise before loading configuration as the PID changes so
    * $TMUX would be wrong for sessions created in the config file.
    */
    - if (daemon(1, 0) != 0)
    - fatal("daemon failed");
    + if (_vprocmgr_detach_from_console(0) != NULL)
    + fatalx("_vprocmgr_detach_from_console failed");

    logfile("server");
    log_debug("server started, pid %ld", (long) getpid());