atop: add alpine patch to fix musl.

This commit is contained in:
Enno Boland 2015-08-16 15:05:48 +02:00
parent 235a2b12fb
commit e540092369
3 changed files with 101 additions and 1 deletions

View File

@ -0,0 +1,35 @@
diff --git atop.daily atop.daily
index c72214c..ac4b3b7 100755
--- atop.daily
+++ atop.daily
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
CURDAY=`date +%Y%m%d`
LOGPATH=/var/log/atop
BINPATH=/usr/bin
@@ -7,15 +7,20 @@ INTERVAL=600 # interval 10 minutes
# verify if atop still runs for daily logging
#
-if [ -e $PIDFILE ] && ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null
+pid=
+if [ -e $PIDFILE ]; then
+ pid=$(cat $PIDFILE)
+fi
+
+if [ -n "$pid" ] && [ -d /proc/$pid ]
then
- kill -USR2 `cat $PIDFILE` # final sample and terminate
+ kill -USR2 $pid # final sample and terminate
CNT=0
- while ps -p `cat $PIDFILE` > /dev/null
+ while [ -d /proc/$pid ]
do
- let CNT+=1
+ CNT=$(($CNT + 1))
if [ $CNT -gt 5 ]
then

View File

@ -0,0 +1,65 @@
--- deviate.c.orig
+++ deviate.c
@@ -178,6 +178,7 @@
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <memory.h>
--- procdbase.c.orig
+++ procdbase.c
@@ -67,7 +67,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
#include "atop.h"
#include "photoproc.h"
--- showgeneric.c.orig
+++ showgeneric.c
@@ -268,7 +268,7 @@
#include <errno.h>
#include <fcntl.h>
#include <string.h>
-#include <termio.h>
+#include <termios.h>
#include <unistd.h>
#include <stdarg.h>
#include <curses.h>
--- showlinux.c.orig
+++ showlinux.c
@@ -274,7 +274,7 @@
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#include <termio.h>
+#include <termios.h>
#include <unistd.h>
#include <stdarg.h>
#include <curses.h>
--- showprocs.c.orig
+++ showprocs.c
@@ -94,7 +94,7 @@
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#include <termio.h>
+#include <termios.h>
#include <unistd.h>
#include <stdarg.h>
#include <curses.h>
--- showsys.c.orig
+++ showsys.c
@@ -80,7 +80,7 @@
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#include <termio.h>
+#include <termios.h>
#include <unistd.h>
#include <stdarg.h>
#include <curses.h>

View File

@ -1,7 +1,7 @@
# Template file for 'atop'
pkgname=atop
version=2.1
revision=2
revision=3
build_style=gnu-makefile
makedepends="ncurses-devel zlib-devel"
short_desc="A system and process level monitor"