Size of the locked file.
.IP "MODE"
-Lock access permissions (read, write).
-
+Lock access permissions (read, write). If the process is blocked and waiting for the lock
+than the '*' (asterisk) postfix is used for the mode.
.IP "M"
Mandatory state of the lock: 0 if none; 1 if set. (See chmod(1)).
char *mode;
off_t start;
off_t end;
- int mandatory;
+ unsigned int mandatory :1,
+ blocked :1;
char *size;
};
case 0: /* ignore */
break;
case 1: /* posix, flock, etc */
- l->type = xstrdup(tok);
+ if (strcmp(tok, "->") == 0) { /* optional field */
+ l->blocked = 1;
+ i--;
+ } else
+ l->type = xstrdup(tok);
break;
case 2: /* is this a mandatory lock? other values are advisory or noinode */
- l->mandatory = *tok == 'M' ? TRUE : FALSE;
+ l->mandatory = *tok == 'M' ? 1 : 0;
break;
case 3: /* lock mode */
l->mode = xstrdup(tok);
xasprintf(&str, "%s", l->size);
break;
case COL_MODE:
- xasprintf(&str, "%s", l->mode);
+ xasprintf(&str, "%s%s", l->mode, l->blocked ? "*" : "");
break;
case COL_M:
- xasprintf(&str, "%d", l->mandatory);
+ xasprintf(&str, "%d", l->mandatory ? 1 : 0);
break;
case COL_START:
xasprintf(&str, "%jd", l->start);