pike.git / lib / modules / PDB.pmod

version» Context lines:

pike.git/lib/modules/PDB.pmod:1:   /* -  * $Id: PDB.pmod,v 1.1 1998/03/23 17:45:29 noring Exp $ +  * $Id: PDB.pmod,v 1.2 1998/03/25 15:25:23 noring Exp $    */      #if constant(thread_create)   #define THREAD_SAFE   #define LOCK() do { object key; catch(key=lock())   #define UNLOCK() key=0; } while(0)   #else   #undef THREAD_SAFE   #define LOCK() do {   #define UNLOCK() } while(0)
pike.git/lib/modules/PDB.pmod:30:    return PDB_ERR("Failed to open file. "+f+": "+strerror(o->errno()));    return o;    }       static int safe_write(object o, string d, string ctx)    {    int warned_already=0;    int n;    for(;;) {    n = o->write(d); -  if(!sov || n == sizeof(d) || n<0) +  if(!sov || n == sizeof(d) || (n<0 && !(<11,12,16,24,28,49>)[o->errno()]))    break;    d = d[n..];    if(!warned_already) { -  PDB_WARN(ctx+": Disk seems to be full."); +  if(n<0) +  PDB_WARN(ctx+": "+strerror(o->errno())+" (sleeping)"); +  else +  PDB_WARN(ctx+": Disk seems to be full. (sleeping)");    warned_already=1;    }    sleep(1);    } -  +  if(warned_already) +  PDB_WARN(ctx+": I'm OK now.");    return (n<0? n : (n==strlen(d)? 1 : 0));    }       static int write_file(string f, mixed d)    {    d = encode_value(d);    catch {    string q;    object g;    if (sizeof(indices(g=Gz))) {