Re: svn commit: r367196 - head/lib/libc/gen
Stefan Eßer wrote: Author: se Date: Sat Oct 31 11:44:10 2020 New Revision: 367196 URL: https://svnweb.freebsd.org/changeset/base/367196 Log: Fix style, no functional change Submitted by: kib MFC after: 3 days Modified: head/lib/libc/gen/sysctl.c Modified: head/lib/libc/gen/sysctl.c == --- head/lib/libc/gen/sysctl.c Sat Oct 31 03:36:31 2020(r367195) +++ head/lib/libc/gen/sysctl.c Sat Oct 31 11:44:10 2020(r367196) @@ -79,23 +79,23 @@ sysctl(const int *name, u_int namelen, void *oldp, siz switch (name[1]) { case USER_CS_PATH: - if (oldp && orig_oldlen < sizeof(_PATH_STDPATH)) { + if (oldp == NULL && orig_oldlen < sizeof(_PATH_STDPATH)) { These checks are not identical, should not the new one be != NULL? errno = ENOMEM; - return -1; + return (-1); } *oldlenp = sizeof(_PATH_STDPATH); if (oldp != NULL) memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH)); return (0); case USER_LOCALBASE: - if (oldp && orig_oldlen < sizeof(_PATH_LOCALBASE)) { + if (oldp == NULL && orig_oldlen < sizeof(_PATH_LOCALBASE)) { Same here. errno = ENOMEM; - return -1; + return (-1); } *oldlenp = sizeof(_PATH_LOCALBASE); if (oldp != NULL) memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE)); - return(0); + return (0); } if (oldp && *oldlenp < sizeof(int)) { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r367141 - head/usr.bin/fetch
Fernando Apesteguía wrote: Author: fernape (ports committer) Date: Thu Oct 29 18:34:47 2020 New Revision: 367141 URL: https://svnweb.freebsd.org/changeset/base/367141 Log: fetch(1): Add EXAMPLES section Add a few examples covering flags: 1, R, a, o, q, r, s, v Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D26946 Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 == --- head/usr.bin/fetch/fetch.1 Thu Oct 29 18:29:22 2020(r367140) +++ head/usr.bin/fetch/fetch.1 Thu Oct 29 18:34:47 2020(r367141) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2018 +.Dd October 29, 2020 .Dt FETCH 1 .Os .Sh NAME @@ -384,6 +384,51 @@ If the argument is used and the remote file is not newer than the specified file then the command will still return success, although no file is transferred. +.Sh EXAMPLES +Silently try to fetch the URLs passed as parameters. +The first one will fail. +If the second URL succeeds the third one will not be tried: +.Bd -literal -offset indent +$ fetch -1 -q https://www.freebsd.org/bad.html \\ + ftp.freebsd.org/pub/FreeBSD/README.TXT \\ + https://www.fake.url +fetch: https://www.freebsd.org/bad.html: Not Found +.Ed +.Pp +Be verbose when retrieving the +.Ql README.TXT +file: +.Bd -literal -offset indent +$ fetch -v ftp.freebsd.org/pub/FreeBSD/README.TXT +resolving server address: ftp.freebsd.org:80 +requesting http://ftp.freebsd.org/pub/FreeBSD/README.TXT +local size / mtime: 4259 / 1431015519 +remote size / mtime: 4259 / 1431015519 +README.TXT4259 B 44 MBps00s +.Ed +.Pp +Quietly save the +.Ql README.TXT file as "file as" should be on separate line, otherwise it's treated as part of .Ql argument. BTW, why are we not using .Pa for these? +.Ql myreadme.txt +and do not delete the output file under any circumstances: +.Bd -literal -offset indent +fetch -o myreadme.txt -q -R ftp.freebsd.org/pub/FreeBSD/README.TXT +.Ed +.Pp +Print the size of the requested file and identify the request with a custom user +agent string: +.Bd -literal -offset indent +$ fetch -s ftp.freebsd.org/pub/FreeBSD/README.TXT +--user-agent="Mozilla/5.0 (X11; FreeBSD x86_64; rv:78.0) Gecko/20100101" +3513231 +.Ed +.Pp +Restart the transfer of the +.Ql README.TXT +file and retry the transfer upon soft failures: +.Bd -literal -offset indent +$ fetch -a -r http://ftp.freebsd.org/pub/FreeBSD/README.TXT +.Ed .Sh SEE ALSO .Xr fetch 3 , .Xr phttpget 8 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r367142 - head/usr.bin/fmt
Fernando Apesteguía wrote: Author: fernape (ports committer) Date: Thu Oct 29 18:37:20 2020 New Revision: 367142 URL: https://svnweb.freebsd.org/changeset/base/367142 Log: fmt(1): Add EXAMPLES section Very small EXAMPLES section. While here, remove reference to nroff(1). Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D26947 Modified: head/usr.bin/fmt/fmt.1 Modified: head/usr.bin/fmt/fmt.1 == --- head/usr.bin/fmt/fmt.1 Thu Oct 29 18:34:47 2020(r367141) +++ head/usr.bin/fmt/fmt.1 Thu Oct 29 18:37:20 2020(r367142) @@ -30,7 +30,7 @@ .\" .\" Modified by Gareth McCaughan to describe the new version of `fmt' .\" rather than the old one. -.Dd December 1, 2017 +.Dd October 29, 2020 .Dt FMT 1 .Os .Sh NAME @@ -89,10 +89,6 @@ Try to format mail header lines contained in the input Format lines beginning with a .Ql \&. (dot) character. -Normally, -.Nm -does not fill these lines, for compatibility with -.Xr nroff 1 . Was the behavior of fmt(1) really changed? If not, you could just replace ".Xr nroff 1 ." with ".Nm nroff . ". .It Fl p Allow indented paragraphs. Without the @@ -159,10 +155,23 @@ environment variables affect the execution of .Nm as described in .Xr environ 7 . +.Sh EXAMPLES +Center the text in standard input: +.Bd -literal -offset indent +$ echo -e 'The merit of all things\enlies\enin their difficulty' | fmt -c + The merit of all things + lies + in their difficulty +.Ed +.Pp +Format the text in standard input collapsing spaces: +.Bd -literal -offset indent +$ echo -e 'Multiple spaceswill be collapsed' | fmt -s +Multiple spaces will be collapsed +.Ed .Sh SEE ALSO .Xr fold 1 , -.Xr mail 1 , -.Xr nroff 1 +.Xr mail 1 .Sh HISTORY The .Nm ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366403 - head/bin/ls
Gordon Bergling wrote: On Sat, Oct 03, 2020 at 09:47:48PM +0300, xto...@hotmail.com wrote: Gordon Bergling wrote: Author: gbe (doc committer) Date: Sat Oct 3 18:34:24 2020 New Revision: 366403 URL: https://svnweb.freebsd.org/changeset/base/366403 Log: ls(1): Bugfix for an issue reported by mandoc - no blank before trailing delimiter MFC after: 1 week Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 == --- head/bin/ls/ls.1Sat Oct 3 18:30:01 2020(r366402) +++ head/bin/ls/ls.1Sat Oct 3 18:34:24 2020(r366403) @@ -40,7 +40,7 @@ .Nd list directory contents .Sh SYNOPSIS .Nm -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 , This makes the "," appear after the "]", how about using the following instead: .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1\&, The comma is appearing right before the ']', like it was before. I'll check the recommended syntax regarding '\&' tomorrow. That's not what I'm seeing: polaris:xtouqh:/usr/src$ svnlite info bin/ls/ls.1 Path: bin/ls/ls.1 Name: ls.1 Working Copy Root Path: /usr/src URL: svn://svn.freebsd.org/base/head/bin/ls/ls.1 Relative URL: ^/head/bin/ls/ls.1 Repository Root: svn://svn.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 366414 Node Kind: file Schedule: normal Last Changed Author: gbe Last Changed Rev: 366403 Last Changed Date: 2020-10-03 18:34:24 + (Sat, 03 Oct 2020) Text Last Updated: 2020-10-03 18:51:31 + (Sat, 03 Oct 2020) Checksum: 72fe092ab2b5ac3363ea0681cfda216876d24fcd $ man bin/ls/ls.1 | head LS(1) FreeBSD General Commands Manual LS(1) NAME ls – list directory contents SYNOPSIS ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1], [--color=when] [-D format] [file ...] DESCRIPTION ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366403 - head/bin/ls
Gordon Bergling wrote: Author: gbe (doc committer) Date: Sat Oct 3 18:34:24 2020 New Revision: 366403 URL: https://svnweb.freebsd.org/changeset/base/366403 Log: ls(1): Bugfix for an issue reported by mandoc - no blank before trailing delimiter MFC after: 1 week Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 == --- head/bin/ls/ls.1Sat Oct 3 18:30:01 2020(r366402) +++ head/bin/ls/ls.1Sat Oct 3 18:34:24 2020(r366403) @@ -40,7 +40,7 @@ .Nd list directory contents .Sh SYNOPSIS .Nm -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 , This makes the "," appear after the "]", how about using the following instead: .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1\&, .Op Fl -color Ns = Ns Ar when .Op Fl D Ar format .Op Ar ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366119 - head/usr.bin/which
Fernando Apesteguía wrote: Author: fernape (ports committer) Date: Thu Sep 24 16:11:53 2020 New Revision: 366119 URL: https://svnweb.freebsd.org/changeset/base/366119 Log: which(1): Add EXAMPLES section to manpage Add EXAMPLES section showing the use of -a and -s flags and how which(1) treates duplicates. Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D26182 Modified: head/usr.bin/which/which.1 Modified: head/usr.bin/which/which.1 == --- head/usr.bin/which/which.1 Thu Sep 24 15:38:01 2020(r366118) +++ head/usr.bin/which/which.1 Thu Sep 24 16:11:53 2020(r366119) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2006 +.Dd September 24, 2020 .Dt WHICH 1 .Os .Sh NAME @@ -62,6 +62,48 @@ command which is similar or identical to this utility. Consult the .Xr builtin 1 manual page. +.Sh EXAMPLES +Locate the +.Xr ls 1 +and +.Xr cp 1 +commands: +.Bd -literal -offset indent +$ /usr/bin/which ls cp +/bin/ls +/bin/cp +.Ed +.Pp +Same as above with a specific +.Va PATH .Ev ? +and showing all occurrences: +.Bd -literal -offset indent +$ PATH=/bin:/rescue /usr/bin/which -a ls cp +/bin/ls +/rescue/ls +/bin/cp +/rescue/cp +.Ed +.Pp +.Nm which +will show duplicates if the same executable is find more than once: found? +.Bd -literal -offset indent +$ PATH=/bin:/bin /usr/bin/which -a ls +/bin/ls +/bin/ls +.Ed +.Pp +Do not show output. +Just exit with an appropriate return code: +.Bd -literal -offset indent +$ /usr/bin/which -s ls cp +$ echo $? +0 + +$ /usr/bin/which -s fakecommand +$ echo $? +1 +.Ed .Sh SEE ALSO .Xr builtin 1 , .Xr csh 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366025 - head/share/man/man9
Warner Losh wrote: Author: imp Date: Tue Sep 22 23:01:53 2020 New Revision: 366025 URL: https://svnweb.freebsd.org/changeset/base/366025 Log: Document devctl_safe_quote_sb This routine centralizes the knowledge needed for properly quoting 'value' in all key="value" items that appear in devctl messages. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D26520 Added: head/share/man/man9/devctl_safe_quote_sb.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileTue Sep 22 23:01:44 2020 (r366024) +++ head/share/man/man9/MakefileTue Sep 22 23:01:53 2020 (r366025) @@ -122,6 +122,8 @@ MAN=accept_filter.9 \ DEV_MODULE.9 \ dev_refthread.9 \ devctl_process_running.9 \ + devctl_safe_quote_sb.9 \ + devctl_ devstat.9 \ devtoname.9 \ disk.9 \ Added: head/share/man/man9/devctl_safe_quote_sb.9 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/devctl_safe_quote_sb.9 Tue Sep 22 23:01:53 2020 (r366025) @@ -0,0 +1,57 @@ +.\" +.\" Copyright (c) 2020 M Warner Losh +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 22, 2020 +.Dt DEVCTL_SAFE_QUOTE_SB 9 +.Os +.Sh NAME +.Nm devctl_safe_quote_sb +.Nd Insert a string, properly quoted, into a sbuf +.Sh SYNOPSIS +.In sys/devctl.h +.In sys/sbuf.h +.Ft void +.Fn devctl_safe_quote_sb "struct sbuf *sb" "const char *src" +.Sh DESCRIPTION +Copy the string from +.Vn src .Va +into +.Vn sb . .Va +All backslash characters are doubled. +All double quote characters +.Sq " .Sq \&" +are also preceded by a backslash. +All other characters are copied without modification. +The +.Xr devctl 4 +protocol requires quoted string to be quoted thus. +This routine centralizes this knowledge. +.Sh SEE ALSO +.Xr devd 8 +.Sh AUTHORS +This manual page was written by +.An M. Warner Losh ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r365984 - head/usr.bin/calendar/calendars
Steffen Nurpmeso wrote: Ian Lepore wrote in : |On Tue, 2020-09-22 at 16:02 +0200, Steffen Nurpmeso wrote: |> Greg Lehey wrote in |> <202009212255.08lmtpsp078...@repo.freebsd.org>: |>|Author: grog |>|Date: Mon Sep 21 22:55:51 2020 |>|New Revision: 365984 |>|URL: https://svnweb.freebsd.org/changeset/base/365984 |>| |>|Log: |>| Remove claim that Allied Forces created "West Germany" in |> 1953. I can |>| find no historic substantiation for such a claim. The Federal |>| Republic of Germany was created by Germans on 23 May 1949, as |> also |>| noted in this file. |> |> I could imagine it was Konrad Adenauer (chancellor at that time) |> refusing (let aside western war winners) the Sowjet offer to |> reunite Germany shall Germany henceforth exist as a "neutral |> state" in the same sense as Switzerland claims to be neutral. |> He refused, instead forward looking to rearm the German army. |> That is, turning Germany to a part of the Western Alliance |> explicitly and willingly. Or was that in 1949? Hm. | |And this is why I agree with Cy and Conrad that we should not be trying |to be wikipedia lite. [offtopic trimmed] Yet again, that's exactly why this needs to go, political stuff has no place in the OS source. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"