Skip to content

Commit

Permalink
lib: only unlink() when we have a pidfile
Browse files Browse the repository at this point in the history
  • Loading branch information
arogge committed Feb 24, 2022
1 parent a85f7f2 commit 59fd6fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/lib/bsys.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2021 Bareos GmbH & Co. KG
Copyright (C) 2013-2022 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -556,7 +556,7 @@ void WritePidFile(int pidfile_fd,
int DeletePidFile(const char* pidfile_path)
{
#if !defined(HAVE_WIN32)
unlink(pidfile_path);
if (pidfile_path) { unlink(pidfile_path); }
#endif
return 1;
}
Expand Down

0 comments on commit 59fd6fe

Please sign in to comment.