Coverage Report

Created: 2024-02-25 06:15

/src/h2o/deps/libyrmcds/text_mode.c
Line
Count
Source (jump to first uncovered line)
1
// (C) 2016 Cybozu.
2
3
#include "yrmcds.h"
4
5
#include <errno.h>
6
7
0
yrmcds_error yrmcds_text_mode(yrmcds* c) {
8
0
    if( c == NULL )
9
0
        return YRMCDS_BAD_ARGUMENT;
10
11
0
#ifndef LIBYRMCDS_NO_INTERNAL_LOCK
12
0
    int e = pthread_mutex_lock(&c->lock);
13
0
    if( e != 0 ) {
14
0
        errno = e;
15
0
        return YRMCDS_SYSTEM_ERROR;
16
0
    }
17
0
#endif // ! LIBYRMCDS_NO_INTERNAL_LOCK
18
19
0
    yrmcds_error ret = YRMCDS_OK;
20
0
    if( c->serial != 0 ) {
21
0
        ret = YRMCDS_IN_BINARY;
22
0
        goto OUT;
23
0
    }
24
25
0
    c->text_mode = 1;
26
27
0
  OUT:
28
0
#ifndef LIBYRMCDS_NO_INTERNAL_LOCK
29
0
    pthread_mutex_unlock(&c->lock);
30
0
#endif
31
0
    return ret;
32
0
}