- Electron version: `1.2.7`
- Operating system: macOS

Attempting to relaunch the app like so

``` js
remote.app.relaunch({ args: remote.process.argv.slice(1).concat(['--dev']) });
remote.app.quit();
```

Throws a really strange error from the `default_app`.

<img width="429" alt="screen shot 2016-07-17 at 1 14 08 pm" src="https://cloud.githubusercontent.com/assets/6634592/16898177/5594b28c-4c20-11e6-8aef-a5d3b91fb643.png">

This is strange as the line it claims to fail on is

https://github.com/electron/electron/blob/master/default_app/main.js#L259

Which does `console.error` so I don't see why it ends up calling `fs.writeSync`

This issue does not occur in the normal Electron app but I assume that is because it isn't attempting to read a `package.json`

atom/browser/relauncher_mac.cc
base::ScopedFD relauncher_sync_fd(kRelauncherSyncFD);
  int parent_pid = getppid();
  
  
  
  
  if (parent_pid == 1) {
    LOG(ERROR) << "unexpected parent_pid";
    return;
  }
  
  base::ScopedFD kq(kqueue());
  if (!kq.is_valid()) {
    PLOG(ERROR) << "kqueue";
    return;
  }
  struct kevent change = { 0 };
  EV_SET(&change, parent_pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL);
  if (kevent(kq.get(), &change, 1, nullptr, 0, nullptr) == -1) {
    PLOG(ERROR) << "kevent (add)";
    return;
  }
  
  if (HANDLE_EINTR(write(relauncher_sync_fd.get(), "", 1)) != 1) {
    PLOG(ERROR) << "write";
    return;
  }