home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************/
- /* */
- /* qw .. queue wait. wait till queue is idle. */
- /* */
- /* usage: qw qname */
- /* */
- /* Copyright (c) Vita Services 1990 */
- /* (c) Vita Fibres 1990 1991 */
- /* */
- /************************************************************************/
-
- #include "qbatch.h"
- int fpq = 0;
- int kflag = 0, rflag = 0;
- char *queuename;
- char queue[128];
- char buff [128];
- #include "config.h"
-
- main (argc, argv, envp)
- int argc;
- char *argv[], *envp[];
- {
-
- if (argc != 2)
- {
- fprintf(stderr, "Usage : qw <qname>\n");
- exit (-1);
- }
- if (strcmp (argv[1], "-v") == 0) q_version();
- queuename = argv[1];
- strcpy (queue, QUEUEPATH);
- strcat (queue, queuename);
- qb_setterm();
- do
- {
- fpq = open (queue, O_RDWR);
- q_lock(fpq);
- read (fpq, &head, sizeof(head));
- if (bad_queue()) qb_exit(-1);
- q_unlock(fpq);
- close (fpq);fpq = 0;
- if (head.qh_pid == 0) break;
- sleep (30);
- }
- while (head.qh_pid != 0);
-
- qb_term (0);
- }
-