Changeset 656 for trunk/server/source3/lib
- Timestamp:
- Nov 8, 2011, 6:50:31 PM (14 years ago)
- Location:
- trunk/server/source3/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/lib/os2helper.c
r655 r656 1 /* This file contains helper functions for OS/2 - 2 do not try to compile on other platforms! */ 1 /* This file contains Samba helper functions for eComStation (OS/2) - 2 * do not try to compile on other platforms! 3 * 4 * Copyright (C) 2007-2011 5 * Silvan Scherrer 6 * Yuri Dario 7 * Paul Smedley 8 * 9 * This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 3 of the License, or 12 * (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, see <http://www.gnu.org/licenses/>. 21 */ 3 22 4 23 #ifdef __OS2__ … … 51 70 { 52 71 /* We call __libc_Back_ioFileSizeSet directly instead of 53 ftruncate to force it not to zero expanding files to optimize 54 samba performance when copying files */72 ftruncate to force it not to zero expanding files to 73 optimize Samba performance when copying files */ 55 74 56 75 int rc = __libc_Back_ioFileSizeSet(fd, size, 0); … … 65 84 int os2_isattribute(char *path, unsigned short attr) 66 85 { 67 68 69 USHORT dosattr;/* attribute to search for */70 71 72 73 if (attr==aARCH)86 HDIR hdirFindHandle = HDIR_CREATE; 87 FILEFINDBUF3 FindBuffer = {0}; /* Returned from FindFirst/Next */ 88 USHORT dosattr; /* attribute to search for */ 89 ULONG ulResultBufLen = sizeof(FILEFINDBUF3); 90 ULONG ulFindCount = 1; /* Look for 1 file at a time */ 91 APIRET rc = NO_ERROR; /* Return code */ 92 if (attr == aARCH) 74 93 dosattr=MUST_HAVE_ARCHIVED; 75 else if (attr==aRONLY)94 else if (attr == aRONLY) 76 95 dosattr=MUST_HAVE_READONLY; 77 else if (attr==aSYSTEM)96 else if (attr == aSYSTEM) 78 97 dosattr=MUST_HAVE_SYSTEM; 79 else if (attr==aHIDDEN)98 else if (attr == aHIDDEN) 80 99 dosattr=MUST_HAVE_HIDDEN; 81 100 82 rc = DosFindFirst( path,/* File pattern - all files */101 rc = DosFindFirst( path, /* File pattern - all files */ 83 102 &hdirFindHandle, /* Directory search handle */ 84 103 dosattr, 85 104 &FindBuffer, /* Result buffer */ 86 105 ulResultBufLen, /* Result buffer length */ … … 88 107 FIL_STANDARD); /* Return Level 1 file info */ 89 108 90 91 92 93 94 109 if (rc != NO_ERROR) { 110 rc = DosFindClose(hdirFindHandle); /* Close our directory handle */ 111 return 1; 112 } else { 113 rc = DosFindClose(hdirFindHandle); /* Close our directory handle */ 95 114 return 0; 96 115 } /* endif */ 97 116 } 98 117 … … 157 176 } 158 177 */ 178 159 179 // OS/2 specific socketpair() implementation, as it only works in low mem 160 180 int os2_socketpair(int fds[2]) 161 181 { 162 182 int mypair[2]; 163 183 int rc = 0; 164 184 165 185 rc = socketpair(AF_UNIX, SOCK_STREAM, 0, mypair); 166 167 168 169 186 if (rc >= 0) { 187 fds[0] = mypair[0]; 188 fds[1] = mypair[1]; 189 } 170 190 171 191 return rc; … … 178 198 void os2_randget(char * buffer, int length) 179 199 { 180 181 182 183 200 UCHAR randbyte(); 201 unsigned int idx; 202 203 for (idx=0; idx<length; idx++) 184 204 buffer[idx] = randbyte(); 185 205 -
trunk/server/source3/lib/recvfile.c
r464 r656 25 25 26 26 #include "includes.h" 27 #ifdef __OS2__ 28 #define pipe(A) os2_socketpair(A) 29 #endif 27 30 28 31 /* Do this on our own in TRANSFER_BUF_SIZE chunks. … … 174 177 } 175 178 176 #ifndef __OS2__177 179 if ((pipefd[0] == -1) && (pipe(pipefd) == -1)) { 178 #else179 if ((pipefd[0] == -1) && (socketpair(AF_UNIX, SOCK_STREAM,0, pipefd) == -1)) {180 #endif181 180 try_splice_call = false; 182 181 return default_sys_recvfile(fromfd, tofd, offset, count); -
trunk/server/source3/lib/select.c
r593 r656 28 28 This means all Samba signal handlers should call sys_select_signal(). 29 29 */ 30 #ifdef __OS2__ 31 #define pipe(A) os2_socketpair(A) 32 #endif 30 33 31 34 static pid_t initialised;
Note:
See TracChangeset
for help on using the changeset viewer.