* check mktemp return value
@ 2011-10-10 9:35 Dave Young
[not found] ` <4E92BC6F.3070805-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Dave Young @ 2011-10-10 9:35 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA
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
--
1.7.4.4
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <4E92BC6F.3070805-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: check mktemp return value [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> 0 siblings, 1 reply; 3+ messages in thread From: Harald Hoyer @ 2011-10-10 9:44 UTC (permalink / raw) To: Dave Young; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA 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. ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <4E92BE8F.20001-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: check mktemp return value [not found] ` <4E92BE8F.20001-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2011-10-10 9:53 ` Dave Young 0 siblings, 0 replies; 3+ messages in thread From: Dave Young @ 2011-10-10 9:53 UTC (permalink / raw) To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-10 9:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox