printobject now returns an error code

This commit is contained in:
Guido van Rossum 1991-06-07 16:10:43 +00:00
parent dd0108081b
commit 909336104b
10 changed files with 70 additions and 86 deletions

View file

@ -117,17 +117,20 @@ file_dealloc(f)
free((char *)f);
}
static void
static int
file_print(f, fp, flags)
fileobject *f;
FILE *fp;
int flags;
{
fprintf(fp, "<%s file ", f->f_fp == NULL ? "closed" : "open");
printobject(f->f_name, fp, flags);
if (printobject(f->f_name, fp, flags) != 0)
return -1;
fprintf(fp, ", mode ");
printobject(f->f_mode, fp, flags);
if (printobject(f->f_mode, fp, flags) != 0)
return -1;
fprintf(fp, ">");
return 0;
}
static object *