int opted_in;
int allow_distro_to_pass_on;
char *submit_url[MAX_URLS];
+char *build_release;
int url_count = 0;
extern int do_unlink;
if (c)
submit_url[url_count++] = strdup(c);
}
+ c = strstr(line, "release-info");
+ if (c) {
+ c += 11;
+ c = strstr(c, "/");
+ if (c)
+ build_release = strdup(c);
+ }
free(line);
}
fclose(file);
+ if (!build_release)
+ build_release = strdup("/etc/meego-release");
if (!url_count)
submit_url[url_count++] = strdup("http://crashdb.meego.com/submitbug.php");
}
#define MAX(A,B) ((A) > (B) ? (A) : (B))
+char *get_build(void) {
+ FILE *file;
+ char *line = NULL;
+ size_t dummy;
+
+ file = fopen(build_release, "r");
+ if (!file) {
+ line = strdup("Unknown");
+ return line;
+ }
+ while (!feof(file)) {
+ line = NULL;
+ if (getline(&line, &dummy, file) <= 0)
+ break;
+ if (strstr(line, "BUILD") != NULL) {
+ char *c;
+
+ c = strchr(line, '\n');
+ if (c) *c = 0;
+
+ c = strstr(line, "BUILD");
+ c += 7;
+ c = strdup(c);
+
+ free(line);
+ fclose(file);
+ return c;
+ }
+ }
+
+ fclose(file);
+
+ line = strdup("Unknown");
+
+ return line;
+}
+
static char *get_release(void) {
FILE *file;
char *line = NULL;
char *build_core_header(char *appfile, char *corefile) {
int ret = 0;
char *result = NULL;
+ char *build = get_build();
char *release = get_release();
char *kernel = get_kernel();
struct timeval tv;
"package: %s\n"
"reason: Process %s was killed by signal %d (%s)\n"
"release: %s\n"
+ "build: %s\n"
"time: %lu\n"
"uid: %d\n"
"\nbacktrace\n-----\n",
package,
appfile, sig, signame(sig),
release,
+ build,
tv.tv_sec,
uid);
free(kernel);
free(package);
free(release);
+ free(build);
free(component);
free(arch);
#
# URL for submitting the backtraces
+# Up to 10 additional URLs can be added in the same format
+# ie:
+# submit-url = http://url1.com/submitbug.php
+# submit-url = http://url2.com/submitbug.php
#
submit-url = http://crashdb.meego.com/submitbug.php
+
+#
+# Location for the MeeGo build release file
+#
+
+release-info = /etc/meego-release
\ No newline at end of file
extern int allow_distro_to_pass_on;
extern char *submit_url[MAX_URLS];
extern int url_count;
+extern char *build_release;
extern int testmode;
extern int pinged;