Skip to content

Commit

Permalink
pistopclient.c: Fixed logic when /home/mbhangui/.pistop doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed Dec 27, 2024
1 parent f88ea58 commit 84633de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Release 1.1 Start 30/06/2022 End --/--/----
- 15/11/2024
49. create_services: use env variables directory in supervise run scripts
(new feature of daemontools 1.1.6)
- 27/11/2024
50. pistopclient.c: Fixed logic when $HOME/.pistop doesn't exist

* Thu Jun 30 2022 18:10:06 IST Manvendra Bhangui <[email protected]> 1.0-1.1%{?dist}
Release 1.0 Start 28/08/2020 End 30/06/2022
Expand Down
9 changes: 6 additions & 3 deletions pistopclient.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: pistopclient.c,v $
* Revision 1.5 2024-12-27 18:47:59+05:30 Cprogrammer
* Fixed logic when $HOME/.pistop doesn't exist
*
* Revision 1.4 2024-07-29 22:05:23+05:30 Cprogrammer
* removed unused function timeoutread
* use timeoutwrite from libqmail
Expand Down Expand Up @@ -173,9 +176,9 @@ main(int argc, char **argv)
errf("HOME not set\n");
_exit(100);
}
if (chdir(ptr) == -1 || chdir(".pistop")== -1 )
strerr_die4sys(111, FATAL, "chdir: ", ptr, "/.pistopstart: ");
if (!access("pistopstart", X_OK)) {
if (chdir(ptr) == -1)
strerr_die4sys(111, FATAL, "chdir: ", ptr, ": ");
if (!chdir(".pistop") || !access("pistopstart", X_OK)) {
if (!stralloc_copys(&pistopstart, ptr) ||
!stralloc_catb(&pistopstart, "/.pistop/pistopstart", 20) ||
!stralloc_0(&pistopstart))
Expand Down

0 comments on commit 84633de

Please sign in to comment.