The Samba-Bugzilla – Attachment 366 Details for
Bug 998
Writes to unlinked files fail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Testcase which shows the failure.
muw.c (text/plain), 754 bytes, created by
Amos Waterland
on 2004-01-22 16:00:59 UTC
(
hide
)
Description:
Testcase which shows the failure.
Filename:
MIME Type:
Creator:
Amos Waterland
Created:
2004-01-22 16:00:59 UTC
Size:
754 bytes
patch
obsolete
>#include <errno.h> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <unistd.h> > >#define SIZE 1024 * 1024 > >int >main (int argc, char **argv) >{ > char buff[SIZE]; > int i, fd; > > for (i = 0; i < SIZE; i++) > buff[i] = 'Z'; > > for (;;) > { > char name[] = "./muw.XXXXXX"; > > if ((fd = mkstemp (name)) == -1) > { > fprintf (stderr, "mkstemp failed: %s\n", strerror (errno)); > return 1; > } > > if (unlink (name)) > { > fprintf (stderr, "unlink failed: %s\n", strerror (errno)); > return 1; > } > > fprintf (stdout, "writing %i bytes to %s ...\n", SIZE, name); > > if (write (fd, buff, SIZE) == -1) > { > fprintf (stderr, "write failed: %s\n", strerror (errno)); > return 1; > } > > close (fd); > } > > return 0; >}
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 Raw
Actions:
View
Attachments on
bug 998
: 366