Commit Graph

16 Commits

Author SHA1 Message Date
andvar 4b2769fe52 fix typos in word "otherwise". 2021-08-01 15:29:29 +00:00
msaitoh ba5c90c4a4 s/sucess/success/ in comment. 2019-12-27 09:45:26 +00:00
roy 67f77b27fc Removed botched debug left over. 2016-04-12 20:40:43 +00:00
roy 4b95ed965b Fix pidfile location path rules to match prior version. 2016-04-12 20:36:35 +00:00
roy 6b9006e83c Implement pidfile_lock, pidfile_read and pidfile_clean.
Discussed on tech-net@, ok core@.
2016-04-10 19:05:50 +00:00
christos 95130e3a90 s/basename/bname/ 2015-01-22 19:04:28 +00:00
christos 0afe4227b1 - not all asprintfs return -1 *and* set buf = NULL, check explicitly.
- don't shadow basename(3)
2015-01-22 16:19:08 +00:00
jmmv 255271589f Extend pidfile(3) to support creating pid files in arbitrary locations.
If the argument provided to pidfile(3) contains a '/', then the value is
considered to be an absolute/relative path and the pid file is created
in the given location.

Otherwise, pidfile(3) behaves as before and treats the provided value as
a basename to construct a pid file in /var/run/<basename>.pid.  This means
that to create a pid file named "foo.pid" in the current directory, one
must specify "./foo.pid".
2011-03-29 13:55:37 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
itojun c2c2980f42 change return type of pidfile(3) to int (-1 on error), to inform caller
of errors.  behavior now in sync with openbsd implementation.
(see tech-userlevel and bsd-api-discuss)
2002-05-22 07:31:40 +00:00
taca 2788a3f274 Remove an extra character in a comment block. 2001-10-20 09:20:28 +00:00
tron 2a957ed711 - Don't delete the pidfile if the process executing the cleanup handler
isn't the process who created it.
- If a new basename is supplied remove the an old pidfile if it was created
  by this process and create a new one as suggested by Jason Thorpe.
This fixes PR lib/13357 by Greg A. Woods.
2001-10-19 20:36:59 +00:00
cgd 65a1026492 convert to use getprogname() 2001-02-19 22:43:42 +00:00
ad fce98185a9 - __RCSID() police.
- ANSIfy.
- Miscellaneous style changes.
- Shutup lint(1) in one or two cases.
2000-07-05 11:46:40 +00:00
thorpej 014350bb41 Use asprintf(3), as suggested by Simon Burge. 1999-06-06 17:31:09 +00:00
thorpej fb695fdcb9 Add pidfile(3), which write a pid file in /var/run, and arranges for it
to be removed on normal exit.
1999-06-06 01:50:00 +00:00