Change-Id: Ibfcffb46715e55d28a3c17749101158e4dbd48e2
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
uint32_t tmp_val;
char adc_buf[ADC_BUFFER_MAX] = {0, };
- lseek(adc->fd, 0, SEEK_SET);
- ret = read(adc->fd, &adc_buf, ADC_BUFFER_MAX);
+ ret = pread(adc->fd, &adc_buf, ADC_BUFFER_MAX, 0);
CHECK_ERROR(ret <= 0);
ret = sscanf(adc_buf, "%d", &tmp_val);
int ret;
int length = 1;
char gpio_buf[GPIO_BUFFER_MAX] = {0, };
- static GMutex mutex;
-
- g_mutex_lock(&mutex);
- lseek(gpio->fd_value, 0, SEEK_SET);
- ret = read(gpio->fd_value, &gpio_buf, length);
- g_mutex_unlock(&mutex);
+ ret = pread(gpio->fd_value, &gpio_buf, length, 0);
CHECK_ERROR(ret != length);
if (gpio_buf[0] == '0') {