title: Error checking on open_lockfile?
body: <p>I've got a <a href="https://github.com/technion/lol_dht22/blob/master/dht22.c" rel="nofollow">c program</a> I"m using off github that intermittently crashes every few days and I think it might be down to "open_lockfile" - maybe the file cannot be opened etc.</p>
  
  <p>How would I go about adding some error level checking on this open_lockfile statement?</p>
  
  <pre><code>#define LOCKFILE "/var/run/dht.lock"
  int lockfd;
  lockfd = open_lockfile(LOCKFILE);
  .
  .
  .
  close_lockfile(lockfd);
  </code></pre>
  
  <p>Update: No wonder I couldn't any info in open_lockfile. It's a function within the c code!</p>