Prepare for disk watch thread

This commit is contained in:
Michiel Broek
2004-03-20 13:26:34 +00:00
parent b94cf4a837
commit a1345b8c84
10 changed files with 204 additions and 34 deletions

View File

@@ -465,6 +465,32 @@ unsigned long sequencer()
/*
* Check enough diskspace.
* return 0=No, 1=Yes, 2=Unknown, 3=Error
*/
int enoughspace(void)
{
char *buf, *res;
int rc = 3;
buf = calloc(SS_BUFSIZE, sizeof(char));
sprintf(buf, "DSPC:0;");
if (socket_send(buf) == 0) {
free(buf);
buf = socket_receive();
res = strtok(buf, ",");
res = strtok(NULL, ";");
rc = atoi(res);
}
Syslog('s', "enoughspace() rc=%d", rc);
return rc;
}
char *printable(char *s, int l)
{
int len;

View File

@@ -1992,6 +1992,7 @@ void UserCity(pid_t, char *, char *);
void DoNop(void);
void Nopper(void);
void Altime(int);
int enoughspace(void);
unsigned long sequencer(void);
char *printable(char *, int);
char *printablec(char);