Complexity of reallocating storage (was users command crap)

Geoffrey Collyer geoff at zoo.toronto.edu
Sat Feb 2 15:51:19 AEST 1991


Dan Bernstein, in response to Ozan Yigit:
> To rephrase: You don't seem to know what good programming techniques are.

>From pty/master.c:

   (void) lseek(fdsess,(long) 0,0);
   (void) read(fdsess,(char *) &newuid,sizeof(int));
   (void) sprintf(newsuid,"%d",newuid);

   (void) chdir("..");
   if (chdir(newsuid) == -1)
    {
     (void) mkdir(newsuid,0700);
     (void) chdir(newsuid);
    }

   (void) sprintf(foo,"../%d/%s",uid,fnsess);
   (void) rename(foo,fnsess);

   (void) sprintf(foo,"../%d/%s",uid,fnre);
   (void) rename(foo,fnre); /* in case we're already disconnected */
-- 
Geoff Collyer		utzoo!geoff, zoo.toronto.edu!geoff



More information about the Comp.lang.c mailing list