diff options
Diffstat (limited to 'storeio/open.c')
-rw-r--r-- | storeio/open.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/storeio/open.c b/storeio/open.c index 805115ce..f6a641d7 100644 --- a/storeio/open.c +++ b/storeio/open.c @@ -35,7 +35,7 @@ open_create (struct dev *dev, struct open **open) (*open)->dev = dev; (*open)->offs = 0; - mutex_init (&(*open)->lock); + pthread_mutex_init (&(*open)->lock, NULL); return 0; } @@ -59,11 +59,11 @@ open_write (struct open *open, off_t offs, void *buf, size_t len, if (offs < 0) /* Use OPEN's offset. */ { - mutex_lock (&open->lock); + pthread_mutex_lock (&open->lock); err = dev_write (open->dev, open->offs, buf, len, amount); if (! err) open->offs += *amount; - mutex_unlock (&open->lock); + pthread_mutex_unlock (&open->lock); } else err = dev_write (open->dev, offs, buf, len, amount); @@ -81,11 +81,11 @@ open_read (struct open *open, off_t offs, size_t amount, if (offs < 0) /* Use OPEN's offset. */ { - mutex_lock (&open->lock); + pthread_mutex_lock (&open->lock); err = dev_read (open->dev, open->offs, amount, buf, len); if (! err) open->offs += *len; - mutex_unlock (&open->lock); + pthread_mutex_unlock (&open->lock); } else err = dev_read (open->dev, offs, amount, buf, len); @@ -101,7 +101,7 @@ open_seek (struct open *open, off_t offs, int whence, off_t *new_offs) { error_t err = 0; - mutex_lock (&open->lock); + pthread_mutex_lock (&open->lock); switch (whence) { @@ -121,7 +121,7 @@ open_seek (struct open *open, off_t offs, int whence, off_t *new_offs) err = EINVAL; } - mutex_unlock (&open->lock); + pthread_mutex_unlock (&open->lock); return err; } |