/ohos5.0/foundation/multimodalinput/input/service/event_dump/test/ |
H A D | event_dump_test.cpp | 52 close(fd_); in TearDown() 53 fd_ = -1; in TearDown() 56 int32_t fd_; member in OHOS::MMI::EventDumpTest 86 MMIEventDump->ParseCommand(fd_, args); 102 MMIEventDump->ParseCommand(fd_, args); 118 MMIEventDump->ParseCommand(fd_, args); 134 MMIEventDump->ParseCommand(fd_, args); 151 MMIEventDump->ParseCommand(fd_, args); 167 MMIEventDump->ParseCommand(fd_, args); 183 MMIEventDump->ParseCommand(fd_, args); [all …]
|
/ohos5.0/foundation/ability/ability_runtime/services/common/include/ |
H A D | fd_guard.h | 30 if (fd_ > -1) { in ~FdGuard() 31 close(fd_); in ~FdGuard() 35 FdGuard(FdGuard &&other) : fd_(other.fd_) in FdGuard() 37 other.fd_ = -1; in FdGuard() 42 if (fd_ > -1) { 43 close(fd_); 45 fd_ = other.fd_; 52 return fd_; in GetFd() 58 fd_ = -1; in Release() 67 fd_ = -1; in Reset() [all …]
|
/ohos5.0/foundation/filemanagement/file_api/interfaces/kits/js/src/common/file_helper/ |
H A D | fd_guard.cpp | 28 FDGuard::FDGuard(FDGuard &&fdg) : fd_(fdg.fd_), autoClose_(fdg.autoClose_) in FDGuard() 30 fdg.fd_ = -1; in FDGuard() 38 this->fd_ = fdg.fd_; in operator =() 40 fdg.fd_ = -1; in operator =() 46 if (fd_ >= 0 && fd_ <= STDERR_FILENO) { in ~FDGuard() 49 if (fd_ >= 0 && autoClose_) { in ~FDGuard() 50 close(fd_); in ~FDGuard() 56 return fd_ >= 0; 61 return fd_; in GetFD() 66 fd_ = fd; in SetFD() [all …]
|
/ohos5.0/foundation/multimedia/av_codec/services/media_engine/modules/muxer/ |
H A D | data_sink_fd.cpp | 31 MEDIA_LOG_D("dup fd is %{public}d", fd_); in DataSinkFd() 32 end_ = lseek(fd_, 0, SEEK_END); in DataSinkFd() 33 if (lseek(fd_, 0, SEEK_SET) < 0) { in DataSinkFd() 42 if (fd_ > 0) { in ~DataSinkFd() 43 MEDIA_LOG_D("close fd is %{public}d", fd_); in ~DataSinkFd() 45 close(fd_); in ~DataSinkFd() 46 fd_ = -1; in ~DataSinkFd() 52 FALSE_RETURN_V_MSG_E(fd_ > 0, -1, "failed to read, fd is %{public}d", fd_); in Read() 57 int32_t size = read(fd_, buf, bufSize); in Read() 65 FALSE_RETURN_V_MSG_E(fd_ > 0, -1, "failed to write, fd is %{public}d", fd_); in Write() [all …]
|
/ohos5.0/commonlibrary/c_utils/base/include/ |
H A D | unique_fd.h | 106 : fd_(value) in UniqueFdAddDeletor() 115 : fd_(-1) in UniqueFdAddDeletor() 135 int tmp = fd_; in Release() 136 fd_ = -1; in Release() 161 return fd_; in Get() 174 fd_ = rhsfd; in UniqueFdAddDeletor() 247 return fd_ > rhs; 275 return fd_ < rhs; 279 int fd_ = -1; 283 if (fd_ >= 0) { in Reset() [all …]
|
/ohos5.0/foundation/ability/idl_tool/util/ |
H A D | file.cpp | 62 fd_ = fopen(path.string(), "w+"); in File() 64 fd_ = fopen(path.string(), "a+"); in File() 67 if (fd_ != nullptr) { in File() 132 isError_ = ferror(fd_) != 0; in Read() 149 if (fd_ == nullptr) { in ReadData() 174 fflush(fd_); in Flush() 180 if (fd_ == nullptr) { in Reset() 189 if (fd_ == nullptr) { in Skip() 198 if (fd_ != nullptr) { in Close() 199 fclose(fd_); in Close() [all …]
|
/ohos5.0/foundation/communication/bluetooth/frameworks/inner/src/ |
H A D | bluetooth_socket.cpp | 94 if (fd_ > 0) { in ~impl() 105 close(fd_); in ~impl() 106 fd_ = -1; in ~impl() 222 if (fd_ <= 0) { in SetBufferSize() 292 int fd_; member 370 fd_(-1), in impl() 383 fd_(fd), in impl() 398 fd_(-1), in impl() 520 return pimpl->fd_; in GetSocketFd() 556 fd_ = -1; in ~impl() [all …]
|
/ohos5.0/foundation/multimedia/media_foundation/src/buffer/avbuffer/ |
H A D | av_hardware_memory.cpp | 42 allocator->fd_ = dup(fd); in CreateHardwareAllocator() 50 : fd_(-1), in AVHardwareAllocator() 63 (void)::close(fd_); in ~AVHardwareAllocator() 64 fd_ = -1; in ~AVHardwareAllocator() 87 if (fd_ > 0) { in Free() 88 (void)::close(fd_); in Free() 89 fd_ = -1; in Free() 109 return fd_; in GetFileDescriptor() 157 if (fd_ > 0) { in ~AVHardwareMemory() 159 fd_ = -1; in ~AVHardwareMemory() [all …]
|
H A D | av_shared_memory_ext.cpp | 81 if (fd_ > 0) { in ~AVSharedMemoryExt() 82 (void)::close(fd_); in ~AVSharedMemoryExt() 83 fd_ = -1; in ~AVSharedMemoryExt() 87 bool ret = allocator_->Free(reinterpret_cast<void *>(fd_)); in ~AVSharedMemoryExt() 96 fd_ = reinterpret_cast<intptr_t>(allocator_->Alloc(allocSize)); in Init() 97 FALSE_RETURN_V_MSG_E(fd_ > 0, Status::ERROR_NO_MEMORY, "Alloc AVSharedMemoryExt failed"); in Init() 108 fd_ = parcel.ReadFileDescriptor(); in Init() 109 FALSE_RETURN_V_MSG_E(fd_ > 0, Status::ERROR_INVALID_DATA, "File descriptor is invalid"); in Init() 165 return fd_; in GetFileDescriptor() 186 uid_, capacity_, memFlag_, fd_); in MapMemoryAddr() [all …]
|
/ohos5.0/foundation/communication/bluetooth_service/services/bluetooth/service/src/hid_host/ |
H A D | hid_host_uhid.cpp | 26 fd_ = -1; in HidHostUhid() 42 if (fd_ < 0) { in Open() 45 if (fd_ < 0) { in Open() 76 if (fd_ >= 0) { in SendData() 97 if (fd_ >= 0) { in SendControlData() 126 if (fd_ >= 0) { in SendHandshake() 186 if (fd_ < 0) { in SendHidInfo() 218 close(fd_); in SendHidInfo() 219 fd_ = -1; in SendHidInfo() 228 if (fd_ >= 0) { in Destroy() [all …]
|
/ohos5.0/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/evloop/src/ |
H A D | event_fd.h | 37 EventFd() : fd_(INVALID_HANDLE) {} in EventFd() 38 explicit EventFd(Handle handle) : fd_(handle) {} in EventFd() 43 fd_ = INVALID_HANDLE; in ~EventFd() 48 return IS_VALID_HANDLE(fd_); in IsValid() 53 return fd_; in Handle() 58 return other.fd_ == fd_; 64 CLOSE_HANDLE(fd_); in Close() 65 fd_ = INVALID_HANDLE; in Close() 70 Handle fd_;
|
/ohos5.0/foundation/window/window_manager/window_scene/test/dms_unittest/ |
H A D | screen_session_dumper_test.cpp | 135 ASSERT_EQ(dumper->fd_, -1); 149 ASSERT_EQ(dumper1->fd_, 1); 155 ASSERT_EQ(dumper2->fd_, 1); 161 ASSERT_EQ(dumper3->fd_, 1); 167 ASSERT_EQ(dumper4->fd_, 1); 206 ASSERT_EQ(dumper->fd_, 1); 221 ASSERT_EQ(dumper->fd_, 1); 235 ASSERT_EQ(dumper->fd_, 1); 249 ASSERT_EQ(dumper->fd_, 1); 263 ASSERT_EQ(dumper->fd_, 1); [all …]
|
/ohos5.0/foundation/filemanagement/dfs_service/utils/system/src/ |
H A D | dfsu_fd_guard.cpp | 25 DfsuFDGuard::DfsuFDGuard(int fd) : fd_(fd) {} in DfsuFDGuard() 27 DfsuFDGuard::DfsuFDGuard(int fd, bool autoClose) : fd_(fd), autoClose_(autoClose) {} in DfsuFDGuard() 31 if (fd_ >= 0 && autoClose_) { in ~DfsuFDGuard() 32 LOGD("DfsuFDGuard Deconstruction, fd_ = %{public}d", fd_); in ~DfsuFDGuard() 33 close(fd_); in ~DfsuFDGuard() 39 return fd_ >= 0; 44 return fd_; in GetFD() 49 fd_ = fd; in SetFD() 55 fd_ = -1; in ClearFD()
|
/ohos5.0/foundation/multimodalinput/input/uinput/ |
H A D | virtual_device.cpp | 53 if (fd_ >= 0) { in ~VirtualDevice() 54 ioctl(fd_, UI_DEV_DESTROY); in ~VirtualDevice() 55 close(fd_); in ~VirtualDevice() 56 fd_ = -1; in ~VirtualDevice() 63 if (fd_ < 0) { in SetUp() 68 if (!DoIoctl(fd_, UI_SET_EVBIT, item)) { in SetUp() 74 if (!DoIoctl(fd_, UI_SET_KEYBIT, item)) { in SetUp() 86 if (!DoIoctl(fd_, UI_SET_ABSBIT, item)) { in SetUp() 92 if (!DoIoctl(fd_, UI_SET_RELBIT, item)) { in SetUp() 112 if (write(fd_, &dev_, sizeof(dev_)) < 0) { in SetUpExt() [all …]
|
/ohos5.0/base/hiviewdfx/hidumper/frameworks/native/src/executor/ |
H A D | zipfolder_output.cpp | 30 ZipFolderOutput::ZipFolderOutput() : fd_(FD_UNSET) in ZipFolderOutput() 39 if (fd_ > FD_UNSET) { in ~ZipFolderOutput() 40 close(fd_); in ~ZipFolderOutput() 43 fd_ = FD_UNSET; in ~ZipFolderOutput() 65 if (fd_ < 0) { in PreExecute() 77 if ((dumpDatas_ == nullptr) || (fd_ < 0)) { in Execute() 98 if (lseek(fd_, 0, SEEK_END) == -1) { in Execute() 102 SaveStringToFd(fd_, outstr); in Execute() 120 if (fd_ > FD_UNSET) { in Reset() 122 close(fd_); in Reset() [all …]
|
/ohos5.0/base/msdp/device_status/intention/ipc/socket/src/ |
H A D | socket_session.cpp | 34 : fd_(fd), uid_(uid), pid_(pid), tokenType_(tokenType), programName_(programName) in SocketSession() 39 if ((fd_ >= 0) && (::close(fd_) != 0)) { in ~SocketSession() 40 FI_HILOGE("close(%{public}d) failed:%{public}s", fd_, ::strerror(errno)); in ~SocketSession() 65 if (fd_ < 0) { in SendMsg() 77 FI_HILOGD("Send message to client (%{public}d, %{public}d)", fd_, pid_); in SendMsg() 78 ssize_t count = send(fd_, &buf[idx], remSize, MSG_DONTWAIT | MSG_NOSIGNAL); in SendMsg() 85 …FI_HILOGE("Send return failed, error:%{public}d, fd:%{public}d, pid:%{public}d", errno, fd_, pid_); in SendMsg() 96 "pid:%{public}d", retryCount, SEND_RETRY_LIMIT, idx, bufSize, fd_, pid_); in SendMsg() 105 oss << "fd = " << fd_ in ToString() 106 << ((fd_ < 0) ? ", closed" : ", opened") in ToString() [all …]
|
/ohos5.0/foundation/multimodalinput/input/intention/ipc/socket/src/ |
H A D | socket_session.cpp | 34 : fd_(fd), uid_(uid), pid_(pid), tokenType_(tokenType), programName_(programName) in SocketSession() 39 if ((fd_ >= 0) && (::close(fd_) != 0)) { in ~SocketSession() 40 FI_HILOGE("close(%{public}d) failed:%{public}s", fd_, ::strerror(errno)); in ~SocketSession() 66 if (fd_ < 0) { in SendMsg() 78 FI_HILOGD("Send message to client (%{public}d, %{public}d)", fd_, pid_); in SendMsg() 79 ssize_t count = send(fd_, &buf[idx], remSize, MSG_DONTWAIT | MSG_NOSIGNAL); in SendMsg() 86 …FI_HILOGE("Send return failed, error:%{public}d, fd:%{public}d, pid:%{public}d", errno, fd_, pid_); in SendMsg() 97 "pid:%{public}d", retryCount, SEND_RETRY_LIMIT, idx, bufSize, fd_, pid_); in SendMsg() 106 oss << "fd = " << fd_ in ToString() 107 << ((fd_ < 0) ? ", closed" : ", opened") in ToString() [all …]
|
/ohos5.0/foundation/ability/idl_tool/idl_tool_2/util/ |
H A D | file.cpp | 54 if (fd_ == nullptr) { in File() 81 if (fd_ == nullptr) { in OpenByRead() 133 isError_ = ferror(fd_) != 0; in Read() 150 if (fd_ == nullptr) { in ReadData() 154 return fread(data, 1, size, fd_); in ReadData() 174 fflush(fd_); in Flush() 180 if (fd_ == nullptr) { in Reset() 189 if (fd_ == nullptr) { in Skip() 198 if (fd_ != nullptr) { in Close() 199 fclose(fd_); in Close() [all …]
|
/ohos5.0/drivers/hdf_core/framework/tools/hdi-gen/util/ |
H A D | file.cpp | 47 if (fd_ == nullptr) { in File() 74 if (fd_ == nullptr) { in OpenByRead() 126 isError_ = ferror(fd_) != 0; in Read() 140 if (fd_ == nullptr) { in ReadData() 144 return fread(data, 1, size, fd_); in ReadData() 164 fflush(fd_); in Flush() 170 if (fd_ == nullptr) { in Reset() 179 if (fd_ == nullptr) { in Skip() 188 if (fd_ != nullptr) { in Close() 189 fclose(fd_); in Close() [all …]
|
/ohos5.0/foundation/distributedhardware/distributed_input/services/source/inputinject/src/ |
H A D | virtual_device.cpp | 44 if (fd_ >= 0) { in ~VirtualDevice() 45 ioctl(fd_, UI_DEV_DESTROY); in ~VirtualDevice() 46 close(fd_); in ~VirtualDevice() 47 fd_ = -1; in ~VirtualDevice() 65 if (!DoIoctl(fd_, uiSet, evt_type)) { in CreateKey() 128 if (fd_ < 0) { in SetUp() 158 if (write(fd_, &dev_, sizeof(dev_)) < 0) { in SetUp() 162 int ret = ioctl(fd_, UI_DEV_CREATE); in SetUp() 167 DHLOGI("create fd %{public}d", fd_); in SetUp() 172 CloseFd(fd_); in SetUp() [all …]
|
/ohos5.0/base/security/code_signature/utils/include/ |
H A D | fsverity_utils_helper.h | 56 if (fd_ > 0) { in Open() 60 fd_ = open(path, O_RDONLY); in Open() 61 if (fd_ <= 0) { in Open() 72 if (fstat(fd_, &st) != 0) { in GetFileSize() 83 if (fd_ > 0) { in ~FileReader() 84 close(fd_); in ~FileReader() 85 fd_ = -1; in ~FileReader() 98 if (fd_ <= 0) { in ReadBytes() 102 ssize_t bytesRead = read(fd_, buf, count); in ReadBytes() 112 int fd_ = -1; variable
|
/ohos5.0/foundation/multimedia/player_framework/services/utils/ |
H A D | uri_helper.cpp | 125 if (fd_ >= 0) { in ~UriHelper() 126 (void)::close(fd_); in ~UriHelper() 127 fd_ = -1; in ~UriHelper() 178 int flags = fcntl(fd_, F_GETFL); in CorrectFdParam() 221 …CHECK_AND_RETURN_RET_LOG(fd_ > 0, false, "Fail to get file descriptor from uri, fd %{public}d", fd… in AccessCheck() 222 int flags = fcntl(fd_, F_GETFL); in AccessCheck() 249 if (fd_ >= 0) { in ParseFdUri() 250 close(fd_); in ParseFdUri() 251 fd_ = -1; in ParseFdUri() 253 fd_ = dup(fd); in ParseFdUri() [all …]
|
/ohos5.0/base/msdp/device_status/utils/ipc/src/ |
H A D | stream_session.cpp | 40 : fd_(fd), pid_(pid) in StreamSession() 50 if (fd_ < 0) { in SendMsg() 61 ssize_t count = send(fd_, &buf[idx], remSize, MSG_DONTWAIT | MSG_NOSIGNAL); in SendMsg() 68 FI_HILOGE("Send return failed, error:%{public}d, fd:%{public}d", errno, fd_); in SendMsg() 79 retryCount, SEND_RETRY_LIMIT, idx, bufSize, fd_); in SendMsg() 88 FI_HILOGD("Enter fd_:%{public}d", fd_); in Close() 89 if (fd_ >= 0) { in Close() 90 if (close(fd_) < 0) { in Close() 91 FI_HILOGE("Close fd failed, error:%{public}s, fd_:%{public}d", strerror(errno), fd_); in Close() 93 fd_ = -1; in Close()
|
/ohos5.0/base/hiviewdfx/hiview/framework/native/unified_collection/collector/device_client/ |
H A D | collect_device_client.cpp | 40 CollectDeviceClient::CollectDeviceClient(): fd_(-1) in CollectDeviceClient() 45 if (fd_ > 0) { in ~CollectDeviceClient() 46 close(fd_); in ~CollectDeviceClient() 69 fd_ = GetDeviceFd(true); in Open() 70 return (fd_ > 0) ? 0 : -1; in Open() 77 int ret = ioctl(fd_, IOCTRL_COLLECT_PROC_COUNT, &processCount); in GetProcessCount() 91 int ret = ioctl(fd_, IOCTRL_COLLECT_ALL_PROC_CPU, data->entry_); in FetchProcessCpuData() 104 int ret = ioctl(fd_, IOCTRL_COLLECT_THE_PROC_CPU, data->entry_); in FetchProcessCpuData() 116 int ret = ioctl(fd_, IOCTRL_COLLECT_THREAD_COUNT, &threadCount); in GetThreadCount() 145 int ret = ioctl(fd_, IOCTRL_COLLECT_THE_THREAD, data->entry_); in FetchThreadCpuData() [all …]
|
/ohos5.0/drivers/peripheral/input/ddk_service/src/emit_event_manager/ |
H A D | virtual_device.cpp | 76 if (fd_ >= 0) { in ~VirtualDevice() 77 ioctl(fd_, UI_DEV_DESTROY); in ~VirtualDevice() 78 close(fd_); in ~VirtualDevice() 79 fd_ = -1; in ~VirtualDevice() 86 if (fd_ < 0) { in SetUp() 118 if (ioctl(fd_, UI_DEV_CREATE) < 0) { in SetUp() 128 if (!DoIoctl(fd_, UI_SET_EVBIT, item)) { in SetAttribute() 134 if (!DoIoctl(fd_, UI_SET_KEYBIT, item)) { in SetAttribute() 146 if (!DoIoctl(fd_, UI_SET_ABSBIT, item)) { in SetAttribute() 152 if (!DoIoctl(fd_, UI_SET_RELBIT, item)) { in SetAttribute() [all …]
|