mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Fix spurious error from sysrc
When using sysrc to modify a file, the file should be created silently. However, with the introduction of SVN r335280, an error of "No such file or directory" would appear despite everything else working as-expected. The nature of this spurious error is that SVN r335280 did not check if the file exists first, before trying to fixup the line-endings in the file just prior to modification. PR: bin/240875 Reported by: Jose Luis Duran MFC after: 3 days
This commit is contained in:
parent
772b3a87bc
commit
e19a2226fe
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355280
|
@ -560,7 +560,7 @@ f_sysrc_set()
|
|||
#
|
||||
if [ "$not_found" ]; then
|
||||
# Add a newline if missing before appending to the file
|
||||
awk 'BEGIN { wc = 0 } NR == 1 {
|
||||
[ ! -e "$file" ] || awk 'BEGIN { wc = 0 } NR == 1 {
|
||||
(cmd = "wc -l " FILENAME) | getline
|
||||
close(cmd)
|
||||
wc = $1
|
||||
|
|
Loading…
Reference in a new issue