Lines Matching refs:sock
264 int sock = socket_local_client("logd", ANDROID_SOCKET_NAMESPACE_RESERVED, in send_log_msg() local
266 if (sock < 0) { in send_log_msg()
267 return sock; in send_log_msg()
275 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in send_log_msg()
282 while ((ret = TEMP_FAILURE_RETRY(read(sock, cp, len))) > 0) { in send_log_msg()
293 p.fd = sock; in send_log_msg()
317 close(sock); in send_log_msg()
468 int e, ret, remaining, sock; in logdOpen() local
474 sock = atomic_load(&transp->context.sock); in logdOpen()
475 if (sock > 0) { in logdOpen()
476 return sock; in logdOpen()
479 sock = socket_local_client("logdr", ANDROID_SOCKET_NAMESPACE_RESERVED, in logdOpen()
481 if (sock == 0) { in logdOpen()
485 close(sock); in logdOpen()
486 sock = newsock; in logdOpen()
488 if (sock <= 0) { in logdOpen()
489 if ((sock == -1) && errno) { in logdOpen()
492 return sock; in logdOpen()
549 ret = write(sock, buffer, cp - buffer); in logdOpen()
560 close(sock); in logdOpen()
570 ret = atomic_exchange(&transp->context.sock, sock); in logdOpen()
571 if ((ret > 0) && (ret != sock)) { in logdOpen()
574 return sock; in logdOpen()
656 int sock = atomic_exchange(&transp->context.sock, -1); in logdClose() local
657 if (sock > 0) { in logdClose()
658 close(sock); in logdClose()