New package: mon-1.2.3

Closes #2468
This commit is contained in:
Jürgen Buchmüller 2015-09-09 22:53:46 +02:00
parent bd24b194f4
commit 06e4f27b4e
3 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,22 @@
Size of long may be 32-bit and thus can't hold MS_YEAR.
--- deps/ms.c 2013-12-01 18:34:08.000000000 +0100
+++ deps/ms.c 2015-09-09 22:47:16.476393763 +0200
@@ -91,7 +91,7 @@
milliseconds_to_string(long long ms) {
char *str = malloc(MS_MAX);
if (!str) return NULL;
- long div = 1;
+ long long div = 1;
char *fmt;
if (ms < MS_SEC) fmt = "%lldms";
@@ -113,7 +113,7 @@
char *
milliseconds_to_long_string(long long ms) {
- long div;
+ long long div;
char *name;
char *str = malloc(MS_MAX);

View File

@ -0,0 +1,14 @@
Fix a minor warning about ignoring the result of write(2).
--- src/mon.c 2013-12-01 18:34:08.000000000 +0100
+++ src/mon.c 2015-09-09 22:42:21.241394637 +0200
@@ -112,7 +112,8 @@
snprintf(buf, 32, "%d", pid);
int fd = open(file, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
if (fd < 0) perror("open()");
- write(fd, buf, 32);
+ ssize_t wrote = write(fd, buf, 32);
+ if (wrote != 32) perror("write()");
close(fd);
}

20
srcpkgs/mon/template Normal file
View File

@ -0,0 +1,20 @@
# Template file for 'mon'
pkgname=mon
version=1.2.3
revision=1
build_style=gnu-makefile
short_desc="Simple single-process process monitoring program written in C"
maintainer="Diogo Leal <diogo@diogoleal.com>"
license="MIT"
homepage="https://github.com/tj/mon"
distfiles="https://github.com/tj/mon/archive/${version}.tar.gz"
checksum=978711a1d37ede3fc5a05c778a2365ee234b196a44b6c0c69078a6c459e686ac
CFLAGS="-Ideps -std=c99 -D_GNU_SOURCE"
do_install() {
vbin mon
vsconf example/on_error.sh
vsconf example/program.sh
vdoc Readme.md
}