Annotation of researchv10dc/ipc/libipc/ipcmesgexec.c, revision 1.1.1.1

1.1       root        1: #include <ipc.h>
                      2: #include "defs.h"
                      3: 
                      4: extern int mesg_ld;
                      5: 
                      6: /*
                      7:  *  Perform a remote execution of a command with message line discipline.
                      8:  */
                      9: ipcmesgexec(name, param, cmd)
                     10:        char *name;
                     11:        char *param;
                     12:        char *cmd;
                     13: {
                     14:        int fd, len;
                     15:        char ds[PATHLEN];
                     16: 
                     17:        strcpy(ds, name);
                     18:        strcat(ds, "!");
                     19:        strcat(ds, "mesgexec");
                     20:        fd = ipcopen(ds, param);
                     21:        if (fd<0)
                     22:                return -1;
                     23:        if (ipclogin(fd)<0) {
                     24:                close(fd);
                     25:                return -1;
                     26:        }
                     27:        len = strlen(cmd)+1;
                     28:        if (write(fd, cmd, len)!=len) {
                     29:                errstr = "write error";
                     30:                close(fd);
                     31:                return -1;
                     32:        }
                     33:        return fd;
                     34: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.