From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org
Subject: selftests: Testing a write attempt into a full file?
Date: Sun, 03 Dec 2017 20:46:55 +0000 [thread overview]
Message-ID: <428c83c2-4752-0fe4-b135-fa23b69dca78@users.sourceforge.net> (raw)
Hello,
I have constructed another demonstration program.
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *f = fopen("/dev/full", "a");
if (!f)
goto report_failure;
{
int const c = 'X';
if (fputc(c, f) != c)
goto report_failure;
}
return EXIT_SUCCESS;
report_failure:
perror(__func__);
return errno;
}
I got the following result.
elfring@Sonne:~/Projekte/selftests> gcc-7 putc_into_full_file1.c && ./a.out; echo $?
0
Does such a simple test example need further software development considerations?
Regards,
Markus
next reply other threads:[~2017-12-03 20:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-03 20:46 SF Markus Elfring [this message]
2017-12-03 21:59 ` selftests: Testing a write attempt into a full file? walter harms
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=428c83c2-4752-0fe4-b135-fa23b69dca78@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).