[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sadc and flock



On Fri, Apr 09, 2004 at 03:03:56PM -0600, Grant Grundler wrote:
> Hi all,
> I was getting cron job output from /usr/lib/sysstat/sa1 script.
> The error was something like "flock: resource not avaiable".

Grant,

Can you try this sysstat package and see if you still have problems?
http://www.parisc-linux.org/~carlos/sysstat/

There are two debs that need to be installed.

It's probably the curse of EAGAIN != EWOULDBLOCK. Oh BTW, it's the same
issue with "menu" aswell.

Cheers,
Carlos.

--- sysstat-5.0.3.orig/sadc.c	2004-04-06 14:24:58.000000000 -0400
+++ sysstat-5.0.3/sadc.c	2004-05-12 01:38:39.148745744 -0400
@@ -502,8 +502,8 @@
    if (USE_L_OPTION(*flags)) {
       /* Yes: try to lock file */
       if (flock(fd, LOCK_EX | LOCK_NB) < 0) {
-	 if (((errno == EWOULDBLOCK) && (fatal == FATAL)) ||
-	      (errno != EWOULDBLOCK)) {
+	 if (((errno == EWOULDBLOCK || errno == EAGAIN) && (fatal == FATAL)) ||
+	      (errno != EWOULDBLOCK && errno != EAGAIN)) {
 	    perror("flock");
 	    exit(1);
 	 }



Reply to: