The Samba-Bugzilla – Attachment 674 Details for
Bug 1804
FreeBSD's mknod can't create FIFOs and sockets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adapted the referenced diff for the modern codebase
mkfifo.diff (text/plain), 1.09 KB, created by
Wayne Davison
on 2004-09-22 09:51:36 UTC
(
hide
)
Description:
Adapted the referenced diff for the modern codebase
Filename:
MIME Type:
Creator:
Wayne Davison
Created:
2004-09-22 09:51:36 UTC
Size:
1.09 KB
patch
obsolete
>--- orig/rsync.h 2004-09-22 08:47:31 >+++ rsync.h 2004-07-03 20:23:33 >@@ -163,6 +163,10 @@ enum msgcode { > #include <sys/socket.h> > #endif > >+#ifdef HAVE_SYS_UN_H >+#include <sys/un.h> >+#endif >+ > #ifdef HAVE_STRING_H > #include <string.h> > #endif >--- orig/syscall.c 2004-08-02 21:56:59 >+++ syscall.c 2004-06-18 17:38:35 >@@ -76,6 +76,29 @@ int do_mknod(char *pathname, mode_t mode > { > if (dry_run) return 0; > RETURN_ERROR_IF_RO_OR_LO; >+# if HAVE_MKFIFO >+ if (S_ISFIFO(mode)) >+ return mkfifo(pathname, mode); >+# endif >+# if HAVE_SYS_UN_H >+ if (S_ISSOCK(mode)) { >+ int sock; >+ struct sockaddr_un saddr; >+ int len = strlen(pathname) + 1; /* include null */ >+ >+ saddr.sun_family = AF_UNIX; >+ strncpy(saddr.sun_path, pathname, sizeof saddr.sun_path); >+ saddr.sun_len = len > sizeof saddr.sun_path ? sizeof saddr.sun_path : len; >+ >+ if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) >+ return -1; >+ unlink(pathname); >+ if ((bind(sock, (struct sockaddr*)&saddr, sizeof saddr)) < 0) >+ return -1; >+ close(sock); >+ return do_chmod(pathname, mode); >+ } >+# endif > return mknod(pathname, mode, dev); > } > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1804
:
674
|
677