FreeBSD Bugzilla – Attachment 8841 Details for
Bug 18361
[MFC] [PATCH] Fix for queue-ordering problem in lpr/lpd/lpq
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.04 KB, created by
Garance A Drosehn
on 2000-05-03 05:10:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Garance A Drosehn
Created:
2000-05-03 05:10:01 UTC
Size:
1.04 KB
patch
obsolete
>--- common_source/common.c.orig Fri Aug 27 21:16:47 1999 >+++ common_source/common.c Tue May 2 23:06:07 2000 >@@ -175,11 +175,24 @@ > compar(p1, p2) > const void *p1, *p2; > { >- if ((*(struct queue **)p1)->q_time < (*(struct queue **)p2)->q_time) >+ const struct queue *qe1, *qe2; >+ qe1 = *(const struct queue **)p1; >+ qe2 = *(const struct queue **)p2; >+ >+ if (qe1->q_time < qe2->q_time) return(-1); >+ if (qe1->q_time > qe2->q_time) return(1); >+ /* >+ * At this point, the two files have the same last-modification time. >+ * return a result based on filenames, so that 'cfA001some.host' will >+ * come before 'cfA002some.host'. Since the jobid ('001') will wrap >+ * around when it gets to '999', we also assume that '9xx' jobs are >+ * older than '0xx' jobs. >+ */ >+ if ((qe1->q_name[3] == '9') && (qe2->q_name[3] == '0')) > return(-1); >- if ((*(struct queue **)p1)->q_time > (*(struct queue **)p2)->q_time) >+ if ((qe1->q_name[3] == '0') && (qe2->q_name[3] == '9')) > return(1); >- return(0); >+ return(strcmp(qe1->q_name,qe2->q_name)); > } > > /* sleep n milliseconds */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18361
: 8841