Skip to content

Commit

Permalink
Plan 9 from Bell Labs 2003-05-10
Browse files Browse the repository at this point in the history
  • Loading branch information
0intro committed May 10, 2003
1 parent 1f37cd7 commit 131b3c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions port/sysfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ sys_stat(ulong *arg)
Chan *c;
uint l;
uchar buf[128]; /* old DIRLEN plus a little should be plenty */
char strs[128];
char strs[128], *name;
Dir d;
char old[] = "old stat system call - recompile";

Expand All @@ -1265,6 +1265,9 @@ sys_stat(ulong *arg)
/* buf contains a new stat buf; convert to old. yuck. */
if(l <= BIT16SZ) /* buffer too small; time to face reality */
error(old);
name = cnamelast(c->name);
if(name)
l = dirsetname(name, strlen(name), buf, l, sizeof buf);
l = convM2D(buf, l, &d, strs);
if(l == 0)
error(old);
Expand Down Expand Up @@ -1298,7 +1301,7 @@ sys_fstat(ulong *arg)
error(old);
name = cnamelast(c->name);
if(name)
l = dirsetname(name, strlen(name), (uchar*)arg[1], l, arg[2]);
l = dirsetname(name, strlen(name), buf, l, sizeof buf);
l = convM2D(buf, l, &d, strs);
if(l == 0)
error(old);
Expand Down

0 comments on commit 131b3c5

Please sign in to comment.