Method: Shadow::Passwd.lock

Defined in:
ext/shadow/shadow.c

.lockObject



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'ext/shadow/shadow.c', line 207

static VALUE
rb_shadow_lock(VALUE self)
{
  int result;

  if( rb_iterator_p() ){
    result = lckpwdf();
    if( result == -1 ){
      rb_raise(rb_eFileLock,"password file was locked");
    }
    else{
      in_lock++;
      rb_yield(Qnil);
      in_lock--;
      ulckpwdf();
    };
    return Qtrue;
  }
  else{
    return rb_shadow_lckpwdf(self);
  };
};