about summary refs log tree commit diff
path: root/nq.c
Commit message (Collapse)AuthorAgeFilesLines
* nq: add support for a $NQFAILDIRPulux2022-09-251-1/+21
|
* nq: change default permissions to 0666 (subject to umask)Leah Neukirchen2021-12-151-1/+1
| | | | This should be the default behavior for programs creating new files.
* nq: open lock files read-only when we don't write into themLeah Neukirchen2021-12-151-4/+4
| | | | flock(fd, LOCK_EX) should still work.
* nq: only change u+x bit to mark running jobLeah Neukirchen2021-12-151-4/+16
|
* donepathjonsykkel2021-05-011-1/+1
| | | | Closes: #38 [via git-merge-pr]
* nq: simplify O_DIRECTORY usageLeah Neukirchen2021-03-131-8/+4
|
* nq: initialize fd with -1 instead of a possible valid valueLeah Neukirchen2021-03-131-1/+1
|
* nq: add support for a $NQDONEDIRLeah Neukirchen2021-03-131-4/+30
|
* nq: use shared locks when waiting for other lockfilesDuncan Overbruck2021-03-131-4/+4
| | | | | | | | The nq process itself will hold an exclusive lock on its lock file, the other nq processes will now use a shared lock to test if the previous queue item is still locked. By using shared locks, multiple nq processes testing the same shared lock don't interfere with other nq processes checking for locks.
* nq: check d_name fits into newestlocked (our filenames always will)Leah Neukirchen2021-03-131-1/+2
|
* nq: revamp waiting loop to avoid busy loops in contested casesLeah Neukirchen2021-03-131-18/+27
| | | | | | | | | | | | | | | | | As reported in #37, the current rewind-loop has the issue of waiting for a lock on the first file that is locked, but it could be detected as being locked by another process that also just wants to check this file. As both processes rewind the dir and retry in this case, this can yield a busy loop. Instead, find the newest locked file and wait for that. This should result in most nq processes waiting for different locks, so this kind of synchonization cannot appear. In theory, removing the rewinddir would be enough, as later nq runs should not result in enqueuing earlier jobs, but it's better to be safe and check there are no more locked files before we launch our job.
* nq: don't define _XOPEN_SOURCELeah Neukirchen2018-03-071-2/+0
| | | | | This hides LOCK_* on FreeBSD and OpenBSD, and is not needed anyway. Closes #26.
* nq: write_execline: avoid unnecessary quotingLeah Neukirchen2018-03-021-7/+17
|
* nq: fix -w and -t without argumentsLeah Neukirchen2018-01-311-1/+1
|
* nq: properly check for empty command linesLeah Neukirchen2018-01-311-1/+1
| | | | | | | `nq -q` could trigger a segfault before. Found by Leonardo Taccari. Fixes #25.
* nq: add -c to clean job file when process succeededLeah Neukirchen2018-01-181-5/+15
|
* styleLeah Neukirchen2017-08-311-2/+2
|
* Leahize v0.2Leah Neukirchen2017-04-261-2/+1
|
* nq: add dprintf stub for SolarisChristian Neukirchen2016-03-211-0/+22
|
* nq, fq: fall back on when O_DIRECTORY is not definedChristian Neukirchen2016-03-211-0/+4
|
* nq: open dirfd with O_DIRECTORY to fail earlyChristian Neukirchen2015-08-281-1/+1
|
* nq: mkdir $NQDIRChristian Neukirchen2015-08-281-0/+7
|
* nq: error handling for dup2Christian Neukirchen2015-08-271-2/+5
|
* nq: fsync after renameChristian Neukirchen2015-08-271-0/+3
| | | | | For details, see https://groups.google.com/forum/#!topic/comp.unix.programmer/AM2V83RCOVE
* nq: add quiet flag -q.Christian Neukirchen2015-08-251-5/+10
|
* nq.c: fix time_t overflow on 32-bit machinesLv Zheng2015-08-111-1/+1
| | | | | | | In systems where time_t is defined as 32-bit integer, the multiplication by 1000 to get millisecond will cause an integer overflow. Fix this problem by explicit integer conversion.
* nq: check pipe(2) for errors.Christian Neukirchen2015-08-071-1/+4
|
* nq.c: add `static' qualifier to global functions.Lv Zheng2015-08-071-2/+2
|
* nq: launch job in own process group to simplify killing it all.Christian Neukirchen2015-08-071-0/+1
|
* nq: use snprintfChristian Neukirchen2015-08-061-3/+6
|
* fix missed sprintf of int64_tChristian Neukirchen2015-08-031-1/+1
|
* redirect stdout/stderr before waiting, else nq sleep 100; b=$(nq sleep 100) ↵Christian Neukirchen2015-08-031-2/+4
| | | | stalls
* flock(2) is not actually POSIX...Christian Neukirchen2015-08-031-2/+3
|
* deal properly with int64_t valuesChristian Neukirchen2015-08-031-5/+7
|
* export NQJOBID to running jobsChristian Neukirchen2015-08-021-0/+1
|
* add -t to test if queue needs waitingChristian Neukirchen2015-08-021-10/+18
|
* wait for arguments of -wChristian Neukirchen2015-08-021-23/+49
|
* -w doesn't take any argumentsChristian Neukirchen2015-08-021-3/+3
|
* add -wChristian Neukirchen2015-07-311-5/+28
|
* tweaksChristian Neukirchen2015-07-311-6/+10
|
* formattingChristian Neukirchen2015-07-311-3/+4
|
* introductory commentChristian Neukirchen2015-07-311-1/+15
|
* cleanups, usageChristian Neukirchen2015-07-311-5/+10
|
* close stdin/stdout, else it locks e.g. for "nq ... | cat"Christian Neukirchen2015-07-311-0/+2
|
* more cleanupChristian Neukirchen2015-07-311-37/+59
|
* clean up, use a pipe instead of signalsChristian Neukirchen2015-07-311-46/+44
|
* reformatChristian Neukirchen2015-07-311-119/+119
|
* Initial import of nqChristian Neukirchen2015-07-311-0/+175