Browse files

Gettign ready to release 2.0.

  • Loading branch information...
1 parent bde01e9 commit 9ae3b5119fc2062f8f1c15ab05d4ba4b828fcfd2 David Bigagli committed Jan 23, 2012
Showing with 76 additions and 11 deletions.
  1. +57 −0 examples/msg.c
  2. +9 −2 examples/qstring.c
  3. +1 −1 lsbatch/daemons/mbd.log.c
  4. +2 −2 rpm.sh
  5. +7 −6 spec/openlava.spec
View
57 examples/msg.c
@@ -0,0 +1,57 @@
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+
+struct jinfo {
+ char name[32];
+ int z;
+ char *p;
+ int num;
+ char **np;
+};
+
+struct msgbuf {
+ long mtype;
+ char mtext[64];
+};
+
+int
+main(int argc, char **argv)
+{
+ int cc;
+ int msqid;
+ struct msgbuf msg;
+ struct msgbuf msg2;
+ size_t len;
+ struct msqid_ds buf;
+
+ msqid = msgget(IPC_PRIVATE, IPC_CREAT|0666);
+ if (msqid < 0) {
+ perror("msgget()");
+ return -1;
+ }
+
+ cc = msgctl(msqid, IPC_STAT, &buf);
+
+ msg.mtype = 1;
+ sprintf(msg.mtext, "ciao ciao ciao");
+ len = strlen(msg.mtext) + 1;
+
+ cc = msgsnd(msqid, &msg, len, 0);
+ if (cc < 0) {
+ perror("msgsnd");
+ return -1;
+ }
+
+ cc = msgrcv(msqid, &msg2, 2 * len, 0, 0);
+ if (cc < 0) {
+ perror("msgrcv");
+ return -1;
+ }
+
+ printf("%d %s\n", msg2.mtype, msg2.mtext);
+
+ return 0;
+}
View
11 examples/qstring.c
@@ -11,7 +11,7 @@ gimmestr(char *s)
p = buf;
if (s[0] == '"'
&& s[1] == '"')
- return NULL;
+ return "";
++s;
while (*s != '"')
@@ -29,12 +29,19 @@ main(int argc, char **argv)
char p0[32];
char p1[32];
char *s;
+ char *file;
+
+ if (argc != 2) {
+ fprintf(stderr, "\
+usage: qstring filename\n");
+ return -1;
+ }
memset(p, 0, 32);
memset(p0, 0, 32);
memset(p1, 0, 32);
- fp = fopen("myfile", "r");
+ fp = fopen(file, "r");
while (fscanf(fp, "%s%s%s", p, p0, p1) != EOF)
printf("%s %s %s\n", p, p0, p1);
fclose(fp);
View
2 lsbatch/daemons/mbd.log.c
@@ -2134,7 +2134,7 @@ putEventRec1(char *fname)
}
static void
-logFinishedjob(struct jData * job)
+logFinishedjob(struct jData *job)
{
static char fname[] = "logFinishedjob()";
struct submitReq *jobBill = &(job->shared->jobBill);
View
4 rpm.sh
@@ -2,10 +2,10 @@
set -x
#
-# Copyright (c) 2011 openlava foundation
+# Copyright (c) 2011-2012 David Bigagli
#
-major="1"
+major="2"
minor="0"
grep 4.6 /etc/redhat-release > /dev/null
View
13 spec/openlava.spec
@@ -1,4 +1,5 @@
#
+# Copyright (C) 2011-2012 David Bigagli
# Copyright (C) 2007 Platform Computing Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -16,7 +17,7 @@
#
#
-%define major 1
+%define major 2
%define minor 0
%define release 1
@@ -33,7 +34,7 @@
Summary: openlava Distributed Batch Scheduler
Name: openlava
-Version: 1.0
+Version: 2.0
Release: 1
License: GPLv2
Group: Applications/Productivity
@@ -80,7 +81,7 @@ make
%install
# Install binaries, daemons
-make install INSTALL_PREFIX=$RPM_BUILD_ROOT
+#make install prefix=$RPM_BUILD_ROOT%{_openlavatop}
# install directories and files
install -d $RPM_BUILD_ROOT%{_openlavatop}/bin
@@ -228,7 +229,6 @@ install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/lsf/man/man8/nios.8 $RPM_BUILD
install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/lsf/man/man8/pim.8 $RPM_BUILD_ROOT%{_openlavatop}/share/man/man8
install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/lsf/man/man8/res.8 $RPM_BUILD_ROOT%{_openlavatop}/share/man/man8
install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/lsbatch/man8/sbatchd.8 $RPM_BUILD_ROOT%{_openlavatop}/share/man/man8
-
#
# PRE
#
@@ -247,7 +247,7 @@ install -m 644 $RPM_BUILD_DIR/%{name}-%{version}/lsbatch/man8/sbatchd.8 $RPM_BU
#
# set variables
#
-_openlavatop=${RPM_INSTALL_PREFIX}/openlava-1.0
+_openlavatop=${RPM_INSTALL_PREFIX}/openlava-%{version}
# create the symbolic links
ln -sf ${_openlavatop}/bin/bkill ${_openlavatop}/bin/bstop
ln -sf ${_openlavatop}/bin/bkill ${_openlavatop}/bin/bresume
@@ -273,7 +273,7 @@ cp ${_openlavatop}/etc/openlava %{_sysconfdir}/init.d
%postun
-_openlavatop=${RPM_INSTALL_PREFIX}/openlava-1.0
+_openlavatop=${RPM_INSTALL_PREFIX}/openlava-%{version}
rm -f /etc/init.d/openlava
rm -f /etc/profile.d/openlava.*
rm -rf ${_openlavatop}
@@ -425,6 +425,7 @@ rm -rf ${_openlavatop}
%attr(0755,openlava,openlava) %{_openlavatop}/work/logdir
%changelog
+* Mon Jan 23 Releasing openlava 2.0
* Sun Oct 30 2011 modified the spec file so that autoconf creates
- openlava configuration files and use the outptu variables to make
- the necessary subsititution in the them. Change the post install

0 comments on commit 9ae3b51

Please sign in to comment.