lpr: don't rely on dirs having st_size > 0
authorSimon Schubert <corecode@dragonflybsd.org>
Thu, 22 Jan 2009 10:19:21 +0000 (11:19 +0100)
committerSimon Schubert <corecode@dragonflybsd.org>
Thu, 22 Jan 2009 10:25:08 +0000 (11:25 +0100)
commitf8d09cb43d957fad72b19df42cad28a017e55ed5
tree8f399f1375ed4661bb50c9e2e5d000676f1fe762
parentaf6e81e0cebb7890b2a4adeb71a4a32f5fc23b14
lpr: don't rely on dirs having st_size > 0

getq determines the initial size of its queue array based on the st_size
of the queue directory.  If the queue directory is on a HAMMER file
system, this size will be reported as 0.  However the following array
growing logic just doubles the array size, thus always staying at 0.

Use a sensible minimum array size of 20 items (~ 512/24).

Reported-and-fix-by: Patrick Georgi <patrick@georgi-clan.de>
usr.sbin/lpr/common_source/common.c