- Electron version: 0.37.7
- Operating system: MacOS 10.11.4

Create a directory with the attached `package.json` and `main.js` files. The app just calls `app.makeSingleInstance` (code sample copied from the Electron docs) and then creates an empty window.

[package.json.txt](https://github.com/electron/electron/files/233556/package.json.txt)
[main.js.txt](https://github.com/electron/electron/files/233558/main.js.txt)

Type:

```
    rm -rf ~/Library/Application\ Support/Electron
    npm start
```

The app will display

```
    ### version 0.37.7
    ### shouldQuit:  true
```

...even though no other instance is running.

If you create an empty ~/Library/Application\ Support/Electron directory, the app runs as expected.

(Obviously, any established Electron developer will have such a directory and will not notice this bug. Their users will notice it very quickly indeed.)

chromium_src/chrome/browser/process_singleton_posix.cc
#if defined(MAS_BUILD)
  
  
  base::FilePath tmp_dir;
  if (!base::GetTempDir(&tmp_dir)) {
    LOG(ERROR) << "Failed to get temporary directory.";
    return false;
  }
  if (!socket_dir_.Set(tmp_dir.Append("S"))) {
    LOG(ERROR) << "Failed to set socket directory.";
    return false;
  }
#else
  
  
  
  if (!socket_dir_.CreateUniqueTempDir()) {
    LOG(ERROR) << "Failed to create socket directory.";
    return false;
  }
#endif
  
  int dir_mode = 0;
  CHECK(base::GetPosixFilePermissions(socket_dir_.path(), &dir_mode) &&
        dir_mode == base::FILE_PERMISSION_USER_MASK)
      << "Temp directory mode is not 700: " << std::oct << dir_mode;
  
  base::FilePath socket_target_path =
      socket_dir_.path().Append(kSingletonSocketFilename);
  base::FilePath cookie(GenerateCookie());