Changeset 755 for trunk/src/network/socket/qlocalsocket_os2.cpp
- Timestamp:
- Jun 22, 2010, 1:13:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/network/socket/qlocalsocket_os2.cpp
r754 r755 271 271 QString connectingPathName; 272 272 273 274 275 273 276 // determine the full server path 274 if (connectingName.startsWith(QLatin1Char('/'))) { 275 connectingPathName = connectingName; 276 } else { 277 connectingPathName = QDir::tempPath(); 278 connectingPathName += QLatin1Char('/') + connectingName; 277 connectingPathName = QDir::toNativeSeparators(connectingName); 278 if (!connectingName.startsWith(socketPath)) { 279 connectingPathName = socketPath + connectingName; 279 280 } 280 281 281 282 struct sockaddr_un name; 282 283 name.sun_family = PF_UNIX; 283 if (sizeof(name.sun_path) < (uint)connectingPathName.toLatin1().size() + 1) { 284 name.sun_len = sizeof(sockaddr_un); 285 QByteArray cpn = connectingPathName.toLocal8Bit(); 286 if (sizeof(name.sun_path) < (uint)cpn.size() + 1) { 284 287 QString function = QLatin1String("QLocalSocket::connectToServer"); 285 288 errorOccurred(QLocalSocket::ServerNotFoundError, function); 286 289 return; 287 290 } 288 :: memcpy(name.sun_path, connectingPathName.toLatin1().data(),289 connectingPathName.toLatin1().size() + 1); 291 :: 292 290 293 if (-1 == ::connect(connectingSocket, (struct sockaddr *)&name, sizeof(name))) { 291 294 QString function = QLatin1String("QLocalSocket::connectToServer");
Note:
See TracChangeset
for help on using the changeset viewer.