Commit Graph

25 Commits

Author SHA1 Message Date
Ivan Tham
9fcdf89e06 Fix output truncation warning 2020-06-15 00:43:17 +08:00
Ivan Tham
75ad568b48 Update LICENSE year to 2020 2020-06-15 00:40:08 +08:00
Ivan Tham
4b71980933 Major release with tons of improvements
- Minor fix, sigemptyset(&emptymask)
    - Mostly consists of major code changes.

Great thanks to Simon Lieb (pips-) for his help.
2016-11-01 00:24:54 +08:00
Ivan Tham
4844396830 Simple logic fixup and prepare for release
- When -D_NOTIFY, notifycmd (-m) will be runned now
- Remove '\n' in buf in display_state() for -m echo
- Remove break; after usage() since die() is called
- Hooray! TODO is clean, everything is nice for now
- Haha, yet another rectangle blocky commit message
2016-11-01 00:21:20 +08:00
Ivan Tham
ba2d3922fa Display time & state for SIGUSR1 2016-11-01 00:21:19 +08:00
Simon Lieb
44395654d8 Fix signal bursts blocking the counter
As sleep() would only detect a minimum of 1 second of sleeping, using
nanosleep() solves this problem. But we now required to define
POSIX_C_SOURCE >= 199309
2016-11-01 00:21:19 +08:00
Ivan Tham
b5d373cbb4 Fix year in version 2016-11-01 00:21:19 +08:00
Simon Lieb
3678854ad1 Fix separate USR1 handling & time display logic
Make remaining_time() more atomic, in order to avoid receiving a signal
during execution of this function.

Receiving a signal during a signal handler is an undefined behavior.
2016-11-01 00:21:19 +08:00
Simon Lieb
50ed6952f2 Replace signal(2) with sigaction(2) for portability
It also require defining _POSIX_C_SOURCE constant to 1 (see config.mk).

Depending on wether you only want to rely on C99 standard or POSIX 1.
2016-11-01 00:21:19 +08:00
Simon Lieb
22f35d5af4 Prefer sigsuspend(2) over pause(2)
As OpenBSD manual for pause(3) stated, this function is made obsolete by
sigsuspend(2).

We may think it will be removed in future for this *nix.

On linux, this require defining _POSIX_C_SOURCE to 1.
2016-11-01 00:21:19 +08:00
Simon Lieb
0af77c1282 Use pause(2) to suspend timer ticking
See #4 for discussion about waiting for signals, instead of incrementing
timecount with zero value.
2016-11-01 00:21:19 +08:00
Ivan Tham
906a6caa13 Main goto loop to for loop
Thanks to quinq http://lists.suckless.org/hackers/1609/12073.html
2016-11-01 00:21:19 +08:00
Ivan Tham
aa718fd83a Fix logic for i infinal loop
thanks to this I had learned about dprintf and breakpoints
2016-11-01 00:21:16 +08:00
Antonio Bibiano
938cd77b94 Implemented pause/resume on SIGUSR2 2016-07-12 21:06:28 +08:00
Ivan Tham
8e7bd4d2aa Simplify infinal loop 2016-07-11 20:35:56 +08:00
Ivan Tham
c89ef49965 Prevent macro hell 2016-07-11 19:39:13 +08:00
Ivan Tham
58d1470890 Fix failed execvp notifycmd 2016-07-11 18:47:18 +08:00
Ivan Tham
f1fe73aff8 Just comment config.mk to remove libnotify 2016-07-11 17:32:47 +08:00
Ivan Tham
0e87e7c205 Merge remote-tracking branch 'antbbn/master' 2016-07-11 15:53:19 +08:00
Antonio Bibiano
93fda613a2 Brought everything up to date, removed spawn TODO, fixed double print error 2016-07-11 15:26:56 +10:00
Ivan Tham
2502641ce2 Fix spt on OSX (no libnotify)
- Thanks for the person who reviewed my code & gave suggestion
    - Fork notify_send() directly
    - What's next? Parallel timer
2016-05-13 23:13:23 +08:00
Antonio Bibiano
d55edcb9b6 Removed libnotify dependency 2016-05-03 10:29:46 +10:00
Simon Lieb
b7e94be5d0 Notify remaining time on SIGUSR1 signal 2016-02-25 22:16:05 +08:00
Ivan Tham
bf41fc8e6c Better keyword (timer->timers)
- sizeof(a)[0]->sizeof(a[0]) thanks to ekleog
    - Add more work to TODO
2016-02-02 23:10:23 +08:00
Ivan Tham
8f2d5e294f Initial commit 2015-11-28 21:15:26 +08:00