From: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: check mktemp return value
Date: Mon, 10 Oct 2011 17:53:09 +0800 [thread overview]
Message-ID: <4E92C085.7080001@redhat.com> (raw)
In-Reply-To: <4E92BE8F.20001-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On 10/10/2011 05:44 PM, Harald Hoyer wrote:
> On 10.10.2011 11:35, Dave Young wrote:
>>
>> in slackware the default mktemp is not from coreutils.
>> A simply make in test directory mangled my rootfs due
>> to initdir is blank
>>
>> Also mktemp could failed with other reason like ENOSPC or EPERM
>>
>> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>> dracut | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/dracut b/dracut
>> index c9329bd..8237f7a 100755
>> --- a/dracut
>> +++ b/dracut
>> @@ -472,6 +472,10 @@ fi
>>
>> readonly TMPDIR=/var/tmp
>> readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)
>> +[ -z $initdir ] && {
>> + dfatal "mktemp failed."
>> + exit 1
>> +}
>>
>> # clean up after ourselves no matter how we die.
>> trap 'ret=$?;[[ $keep ]] && echo "Not removing $initdir." >&2 || rm -rf
>> "$initdir";exit $ret;' EXIT
>
> pushed...
>
> had to hand edit, because your mailer automatically broke the line.
Sorry about that, I think I have to return to mutt for patch sending
--
Thanks
Dave
prev parent reply other threads:[~2011-10-10 9:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 9:35 check mktemp return value Dave Young
[not found] ` <4E92BC6F.3070805-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-10-10 9:44 ` Harald Hoyer
[not found] ` <4E92BE8F.20001-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-10-10 9:53 ` Dave Young [this message]
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=4E92C085.7080001@redhat.com \
--to=dyoung-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.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