(wrong string) ée

From: <git_AT_suckless.org>
Date: Thu, 25 May 2017 18:23:00 +0200 (CEST)

commit 10363565a1708a5a5adb6e6624de0dde6455ded4
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Thu May 25 18:22:39 2017 +0200
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Thu May 25 18:22:39 2017 +0200

    Document blind-to-named and blind-from-named
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>

diff --git a/README b/README
index 0204564..7a54d51 100644
--- a/README
+++ b/README
_AT_@ -48,6 +48,9 @@ UTILITIES
        blind-from-image(1)
               Convert an image to a frame
 
+ blind-from-named(1)
+ Receive a file descriptor
+
        blind-from-portable(1)
               Convert a video from a portable format to a processable format
 
_AT_@ -117,6 +120,9 @@ UTILITIES
        blind-to-image(1)
               Convert a frame to an image
 
+ blind-to-named(1)
+ Send a file descriptor
+
        blind-to-portable(1)
               Convert a video to a portable format
 
diff --git a/man/blind-from-named.1 b/man/blind-from-named.1
new file mode 100644
index 0000000..afede12
--- /dev/null
+++ b/man/blind-from-named.1
_AT_@ -0,0 +1,64 @@
+.TH BLIND-FROM-NAMED 1 blind
+.SH NAME
+blind-from-named - Receive a file descriptor
+.SH SYNOPSIS
+.B blind-from-named
+[-t
+.IR decisecs ]
+[-a]
+([-f
+.IR fd ]
+.I path
+.RI [ command \ ...]
+|
+.IR path )
+.SH DESCRIPTION
+.B blind-from-named
+connects to a
+.BR unix (7)
+socket with the filename
+.I path
+and received a file descriptor.
+.P
+If a
+.I command
+is specified, the received file descriptor set to
+stdin, and the process executes to the specified
+.IR commmand ,
+otherwise, the input from the received file descriptor
+is sent to stdout.
+.SH OPTIONS
+.TP
+.B -a
+Rather than binding to a filename, create and abstract
+address, starting with a NUL byte followed by
+.I path
+and padded with NUL bytes until the end of the address.
+.TP
+.BR -f \ \fIfd\fP
+Assign the file descriptor number
+.I fd
+to the received file descriptor, rather than as
+stdin.
+.TP
+.BR -t \ \fIdecisecs\fP
+Try to connect to the socket for at most
+.I decisecs
+deciseconds, trying once per decisecond. (Default is 10.)
+.SH RATIONALE
+The pipeline construction, in even advanced, shells
+are not flexible enough to do all kinds of pipelinings
+that are necessary when doing complicated effects with
+.BR blind (7).
+For example, this is necessary to pipe video into
+two processes pipelines using
+.BR tee (1)
+and then using the end of both pipelines as the in
+input to the process, like inverse multiplexing.
+.SH SEE ALSO
+.BR blind (7),
+.BR blind-to-named (1),
+.BR tee (1)
+.SH AUTHORS
+Mattias Andrée
+.RI < maandree_AT_kth.se >
diff --git a/man/blind-to-named.1 b/man/blind-to-named.1
new file mode 100644
index 0000000..5688a5d
--- /dev/null
+++ b/man/blind-to-named.1
_AT_@ -0,0 +1,39 @@
+.TH BLIND-TO-NAMED 1 blind
+.SH NAME
+blind-to-named - Send a file descriptor
+.SH SYNOPSIS
+.B blind-to-named
+[-a]
+.I path
+.SH DESCRIPTION
+.B blind-to-named
+create a
+.BR unix (7)
+socket with the filename
+.I path
+and sends the stdin file descriptor to the
+first process that connects to it.
+.SH OPTIONS
+.TP
+.B -a
+Rather than binding to a filename, create and abstract
+address, starting with a NUL byte followed by
+.I path
+and padded with NUL bytes until the end of the address.
+.SH RATIONALE
+The pipeline construction, in even advanced, shells
+are not flexible enough to do all kinds of pipelinings
+that are necessary when doing complicated effects with
+.BR blind (7).
+For example, this is necessary to pipe video into
+two processes pipelines using
+.BR tee (1)
+and then using the end of both pipelines as the in
+input to the process, like inverse multiplexing.
+.SH SEE ALSO
+.BR blind (7),
+.BR blind-from-named (1),
+.BR tee (1)
+.SH AUTHORS
+Mattias Andrée
+.RI < maandree_AT_kth.se >
diff --git a/man/blind.7 b/man/blind.7
index 2f8d872..f8c4dd0 100644
--- a/man/blind.7
+++ b/man/blind.7
_AT_@ -61,6 +61,9 @@ Mirror a video horizontally
 .BR blind-from-image (1)
 Convert an image to a frame
 .TP
+.BR blind-from-named (1)
+Receive a file descriptor
+.TP
 .BR blind-from-portable (1)
 Convert a video from a portable format to a processable format
 .TP
_AT_@ -130,6 +133,9 @@ Draw new frames on top of old frames with partial alpha
 .BR blind-to-image (1)
 Convert a frame to an image
 .TP
+.BR blind-to-named (1)
+Send a file descriptor
+.TP
 .BR blind-to-portable (1)
 Convert a video to a portable format
 .TP
diff --git a/src/blind-from-named.c b/src/blind-from-named.c
index 1ca4c7f..ee053f2 100644
--- a/src/blind-from-named.c
+++ b/src/blind-from-named.c
_AT_@ -76,7 +76,7 @@ main(int argc, char *argv[])
         struct sockaddr_un addr;
         int abstract = 0;
         int filedes = -1;
- int tries = 10;
+ int tries = 11;
         int sockfd, fd;
 
         ARGBEGIN {
_AT_@ -87,7 +87,7 @@ main(int argc, char *argv[])
                 filedes = etoi_flag('f', UARGF(), 0, INT_MAX);
                 break;
         case 't':
- tries = etoi_flag('t', UARGF(), 1, INT_MAX);
+ tries = etoi_flag('t', UARGF(), 0, INT_MAX - 1) + 1;
                 break;
         default:
                 usage();
_AT_@ -95,7 +95,7 @@ main(int argc, char *argv[])
         if (argc < 1 || (filedes >= 0 && argc > 1))
                 usage();
         if (argc > 0 && filedes < 0)
- filedes = 0;
+ filedes = STDIN_FILENO;
 
         memset(&addr, 0, sizeof(addr));
         addr.sun_family = AF_UNIX;
Received on Thu May 25 2017 - 18:23:00 CEST

This archive was generated by hypermail 2.3.0 : Thu May 25 2017 - 18:24:35 CEST