[vlc-devel] [PATCH 1/5] pkg-static.sh: close file before overwriting it.

Rémi Denis-Courmont remi at remlab.net
Thu Jun 1 10:39:18 CEST 2017


On May 31, 2017 2:56:00 AM GMT+03:00, Robert Mourning <robedmo.git at gmail.com> wrote:
>Improves support for building with Windows Subsystem for Linux.
>When the input file is on DrvFs (windows file system), the "mv"
>command which overwrites the original file fails unless the
>file is closed first.
>
>---
> contrib/src/pkg-static.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/contrib/src/pkg-static.sh b/contrib/src/pkg-static.sh
>index 59cbd78..0c3ceea 100755
>--- a/contrib/src/pkg-static.sh
>+++ b/contrib/src/pkg-static.sh
>@@ -35,4 +35,6 @@ done
> echo "Libs: $LIBS_PUBLIC $LIBS_PRIVATE"
> echo "Requires: $REQUIRES_PUBLIC $REQUIRES_PRIVATE"
> 
>+exec <&-
>+
> mv -f -- "$1.tmp" "$1"
>-- 
>2.7.4
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

Hello,

Closing FD 0 is risky, as a lot of programs assume 0, 1 & 2 are open. Even mv can conditionally use it. Better redirect it from /dev/null if really needed.
-- 
Rémi Denis-Courmont


More information about the vlc-devel mailing list