FreeBSD Bugzilla – Attachment 17129 Details for
Bug 31201
[libdisk] [patch] add free_space(chunk) to libdisk
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 907 bytes, created by
AnarCat
on 2001-10-10 17:40:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
AnarCat
Created:
2001-10-10 17:40:00 UTC
Size:
907 bytes
patch
obsolete
>diff -c /usr/src/lib/libdisk/chunk.c.orig /usr/src/lib/libdisk/chunk.c >*** /usr/src/lib/libdisk/chunk.c.orig Wed Oct 10 12:29:42 2001 >--- /usr/src/lib/libdisk/chunk.c Wed Oct 10 12:29:42 2001 >*************** >*** 16,21 **** >--- 16,22 ---- > #include <string.h> > #include <sys/types.h> > #include <err.h> >+ #include <errno.h> > #include "libdisk.h" > > #define new_chunk() memset(malloc(sizeof(struct chunk)), 0, sizeof(struct chunk)) >*************** >*** 327,332 **** >--- 328,350 ---- > if (c->flags & CHUNK_IS_ROOT) ret[i++] = 'R'; > ret[i++] = '\0'; > return ret; >+ } >+ >+ /* return free space of that chunk */ >+ long >+ free_space(struct chunk *c) >+ { >+ struct chunk *c1; >+ int sz = c->size; >+ if (!c) { >+ errno = EFAULT; >+ return -1; >+ } >+ for (c1 = c->part; c1; c1 = c1->next) { >+ if (c1->type != unused) >+ sz -= c1->size; >+ } >+ return sz; > } > > void
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31201
: 17129 |
17130