Skip to content

Commit

Permalink
Merge commit 'refs/merge-requests/1' of git://gitorious.org/drqueue-m…
Browse files Browse the repository at this point in the history
…irrors/drqueue into integration
  • Loading branch information
kaazoo committed Jul 15, 2010
2 parents 3e46eb5 + d27cd75 commit 11df48b
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 33 deletions.
10 changes: 4 additions & 6 deletions drqman/drqm_computers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,10 @@ computers_cmp_pools (GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2) {
struct computer *ca,*cb;
struct computer_limits *cla,*clb;
int diff;
char pa[BUFFERLEN];
char pb[BUFFERLEN];
char msg2[BUFFERLEN];
int i;

// fix compiler warning
(void)clist;
Expand All @@ -1581,12 +1585,6 @@ computers_cmp_pools (GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2) {
cla = &ca->limits;
clb = &cb->limits;

char pa[BUFFERLEN];
char pb[BUFFERLEN];
char msg2[BUFFERLEN];

int i;

if (cla->npools) {
struct pool *pool;
if ((pool = computer_pool_attach_shared_memory(cla)) != (void*)-1) {
Expand Down
6 changes: 1 addition & 5 deletions drqman/drqm_jobs_3delight.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@
// USA
//

#ifdef HAVE_CONFIG_H
# include <lconfig.h>
#endif

#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
#include <sys/stat.h>
#include <sys/types.h>

#include "drq_stat.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
#include "drqm_jobs_3delight.h"
Expand Down
6 changes: 4 additions & 2 deletions drqman/drqm_jobs_jdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ jdd_update (GtkWidget *w, struct drqm_jobs_info *info) {
static GdkPixmap *f_data = NULL;
static GdkBitmap *e_mask = NULL;
static GdkPixmap *e_data = NULL;
char *submit_time;
time_t ttime;

jdd_update_blocked_hosts (w,info);

Expand Down Expand Up @@ -505,8 +507,8 @@ jdd_update (GtkWidget *w, struct drqm_jobs_info *info) {
info->jdd.job.ffailed);
gtk_label_set_text (GTK_LABEL(info->jdd.lfrldf),msg);

time_t ttime = info->jdd.job.submit_time;
char *submit_time = ctime(&ttime);
ttime = info->jdd.job.submit_time;
submit_time = ctime(&ttime);
submit_time[strlen(submit_time)-1]=0;
gtk_label_set_text (GTK_LABEL(info->jdd.lsubmitt),submit_time);
gtk_label_set_text (GTK_LABEL(info->jdd.lavgt),time_str(info->jdd.job.avg_frame_time));
Expand Down
2 changes: 1 addition & 1 deletion drqman/drqm_jobs_lightwave.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <unistd.h>
#endif
#include <pwd.h>
#include <sys/stat.h>

#include "drq_stat.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
#include "drqm_jobs_lightwave.h"
Expand Down
3 changes: 1 addition & 2 deletions drqman/drqm_jobs_mantra.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
#include <unistd.h>
#endif
#include <pwd.h>
#include <sys/stat.h>


#include "drq_stat.h"
#include "mantrasg.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
Expand Down
2 changes: 1 addition & 1 deletion drqman/drqm_jobs_maya.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <unistd.h>
#endif
#include <pwd.h>
#include <sys/stat.h>

#include "drq_stat.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
#include "drqm_jobs_maya.h"
Expand Down
5 changes: 3 additions & 2 deletions drqman/drqm_jobs_mentalray.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <unistd.h>
#endif
#include <pwd.h>
#include <sys/stat.h>

#include "drq_stat.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
#include "drqm_jobs_mentalray.h"
Expand Down Expand Up @@ -297,8 +297,9 @@ dnj_koj_frame_mentalray_scene_set (GtkWidget *button, struct drqmj_koji_mentalra
static void
dnj_koj_frame_mentalray_bcreate_pressed (GtkWidget *button, struct drqmj_dnji *info) {
struct mentalraysgi mentalraysgi; /* Mental Ray script generator info */
mentalraysgi.render_type = 1; /* we render animations */
char *file;

mentalraysgi.render_type = 1; /* we render animations */

// fix compiler warning
(void)button;
Expand Down
2 changes: 1 addition & 1 deletion drqman/drqm_jobs_nuke.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <unistd.h>
#endif
#include <pwd.h>
#include <sys/stat.h>

#include "drq_stat.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
#include "drqm_jobs_nuke.h"
Expand Down
2 changes: 1 addition & 1 deletion drqman/drqm_jobs_terragen.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#endif
#include <stdlib.h>
#include <pwd.h>
#include <sys/stat.h>
#include <sys/types.h>

#include "drq_stat.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
#include "drqm_jobs_terragen.h"
Expand Down
2 changes: 1 addition & 1 deletion drqman/drqm_jobs_turtle.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <unistd.h>
#endif
#include <pwd.h>
#include <sys/stat.h>

#include "drq_stat.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
#include "drqm_jobs_turtle.h"
Expand Down
2 changes: 1 addition & 1 deletion drqman/drqm_jobs_xsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <unistd.h>
#endif
#include <pwd.h>
#include <sys/stat.h>

#include "drq_stat.h"
#include "drqm_jobs.h"
#include "drqm_common.h"
#include "drqm_jobs_xsi.h"
Expand Down
12 changes: 11 additions & 1 deletion drqman/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ int main (int argc, char *argv[]) {
GtkWidget *window;
GtkWidget *main_vbox;
char rc_file[MAXCMDLEN];
int nRet = 0;

gtk_init(&argc,&argv);

if(network_initialize() != 0) {
fprintf (stderr,"Could not initialize the network: %s\n", drerrno_str());
nRet = 1;
goto cleanup;
}

// fprintf (stderr,"drqman pid: %i\n",getpid());
drqman_get_options(&argc,&argv);
set_default_env(); // Config files overrides environment
Expand Down Expand Up @@ -93,7 +100,10 @@ int main (int argc, char *argv[]) {

gtk_main();

return (0);
cleanup:
network_shutdown();

return nRet;
}

void drqman_get_options (int *argc,char ***argv) {
Expand Down
8 changes: 4 additions & 4 deletions libdrqueue/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// USA
//
#include <stdio.h>
#include <sys/stat.h>

#include "drq_stat.h"
#include "common.h"
#include "drerrno.h"
#include "constants.h"
Expand Down Expand Up @@ -54,7 +54,7 @@ common_environment_check (void) {
log_auto (L_ERROR,"Could not find temp path '%s'. (%s)",dir_str,strerror(drerrno_system));
return 0;
} else {
#ifdef __CYGWIN
#if defined (__CYGWIN) || defined(_WIN32)
if (!S_ISDIR(s_stat.st_mode)) {
drerrno = DRE_NOTMPDIR;
return 0;
Expand All @@ -78,7 +78,7 @@ common_environment_check (void) {
drerrno = DRE_NODBDIR;
return 0;
} else {
#ifdef __CYGWIN
#if defined (__CYGWIN) || defined(_WIN32)
if (!S_ISDIR(s_stat.st_mode)) {
drerrno_system = errno;
log_auto (L_ERROR,"no database directory found on '%s'. It's not a directory. (%s)",dir_str,strerror(drerrno_system));
Expand All @@ -104,7 +104,7 @@ common_environment_check (void) {
drerrno = DRE_NOLOGDIR;
return 0;
} else {
#ifdef __CYGWIN
#if defined (__CYGWIN) || defined(_WIN32)
if (!S_ISDIR(s_stat.st_mode)) {
drerrno = DRE_NOLOGDIR;
return 0;
Expand Down
8 changes: 6 additions & 2 deletions libdrqueue/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
//

#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include "drq_stat.h"
#include "pointer.h"
#include "database.h"
#include "computer.h"
Expand Down Expand Up @@ -266,8 +266,12 @@ database_save (struct database *wdb) {
if ((fd = open (filename, O_CREAT | O_TRUNC | O_RDWR, 0664)) == -1) {
if (errno == ENOENT) {
/* If its because the directory does not exist we try creating it first */
#ifdef _WIN32
if (mkdir (dir) == -1) {
#else
if (mkdir (dir, 0775) == -1) {
drerrno_system = errno;
#endif
drerrno_system = errno;
log_auto (L_WARNING,"Could not create database directory. Check permissions: %s. (%s)",
dir,strerror(drerrno_system));
drerrno = DRE_COULDNOTCREATE;
Expand Down
31 changes: 31 additions & 0 deletions libdrqueue/drq_stat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (C) 2010 Alistair Leslie-Hughes
*
* This file is part of DrQueue
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/

#ifndef _DRQ_STAT_H_
#define _DRQ_STAT_H_

#include <sys/stat.h>

#ifndef S_ISDIR
#define S_ISDIR _S_ISDIR
#endif

#endif
5 changes: 3 additions & 2 deletions libdrqueue/jobscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
// USA
//
#include <stdio.h>
#include <sys/stat.h>

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include "drq_stat.h"
#include "libdrqueue.h"

/* create a new script file */
Expand All @@ -47,8 +47,9 @@ jobscript_new (jobscript_type type, char *filename) {
return NULL;
}

#ifndef _WIN32
fchmod (fileno(f),0777);

#endif
jsi = (struct jobscript_info*) malloc (sizeof (struct jobscript_info));
if(jsi) {
jsi->type = type;
Expand Down
6 changes: 5 additions & 1 deletion libdrqueue/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdarg.h>
#include <fcntl.h>
#include <sys/stat.h>

#ifdef HAVE_UNISTD_H
#include <unistd.h>
Expand All @@ -32,6 +31,7 @@
#include <process.h>
#endif

#include "drq_stat.h"
#include "libdrqueue.h"

int loglevel = L_INFO;
Expand Down Expand Up @@ -363,7 +363,11 @@ int
log_path_create (char *path) {
int rv;

#ifdef _WIN32
if ((rv = mkdir (path)) == -1) {
#else
if ((rv = mkdir (path,0777)) == -1) {
#endif
drerrno_system = errno;
return 0;
}
Expand Down

0 comments on commit 11df48b

Please sign in to comment.