Skip to content

Commit

Permalink
Merge pull request #426 from nodogsplash/4.0.3beta
Browse files Browse the repository at this point in the history
ndsctl: delete lock file if NDS is not started
  • Loading branch information
bluewavenet committed Sep 2, 2019
2 parents 5f58ccc + 4ded1a1 commit 5bf6b98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/binauth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The script file must be executable and is flagged as such in the source archive.

This script is then activated with the command:

'service nodogsplash restart'
`service nodogsplash restart`

**The Example 1 script contains the following code:**

Expand Down Expand Up @@ -258,7 +258,7 @@ The script file must be executable and is flagged as such in the source archive.

This script is then activated with the command:

'service nodogsplash restart'
`service nodogsplash restart`

**The Example 2 script contains the following code:**

Expand Down
2 changes: 2 additions & 0 deletions src/ndsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static int
connect_to_server(const char sock_name[])
{
int sock;
char lockfile[] = "/tmp/ndsctl.lock";
struct sockaddr_un sa_un;

/* Connect to socket */
Expand All @@ -124,6 +125,7 @@ connect_to_server(const char sock_name[])

if (connect(sock, (struct sockaddr *)&sa_un, strlen(sa_un.sun_path) + sizeof(sa_un.sun_family))) {
fprintf(stderr, "ndsctl: nodogsplash probably not started (Error: %s)\n", strerror(errno));
remove(lockfile);
return -1;
}

Expand Down

0 comments on commit 5bf6b98

Please sign in to comment.